Package uk.ac.starlink.datanode.nodes
Interface DetailViewer
public interface DetailViewer
Defines an interface for nodes to display detailed information about
themselves. Methods are provided for simple text markup (heading-value
pairs) and addition of deferred-constructions panels for custom display
of relevant data.
- Author:
- Mark Taylor (Starlink)
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddKeyedItem(String name, boolean value) Adds a key-value paired information item for boolean data.voidaddKeyedItem(String name, double value) Adds a key-value paired information item for double data.voidaddKeyedItem(String name, float value) Adds a key-value paired information item for float data.voidaddKeyedItem(String name, int value) Adds a key-value paired information item for int data.voidaddKeyedItem(String name, long value) Adds a key-value paired information item for long data.voidaddKeyedItem(String name, Object value) Adds a key-value paired information item for Object data.voidaddKeyedItem(String name, String value) Adds a key-value paired information item for string data.voidAdds a component for optional display within this viewer.voidaddPane(String title, ComponentMaker maker) Adds a deferred-construction component for optional display within this viewer.voidaddScalingPane(String title, ComponentMaker maker) Adds a new deferred-construction component which will draw itself at a size appropriate to the size of its container.voidAdds a visible separator to the display.voidaddSpace()Adds a small amount of space to the overview display.voidaddSubHead(String text) Adds a subheading to the display.voidAdds unformatted text to the display.voidAdds a top-level title to the display.voidLogs an error in supplying data in some visible fashion.
-
Method Details
-
addTitle
Adds a top-level title to the display.- Parameters:
title- title text
-
addSubHead
Adds a subheading to the display.- Parameters:
text- subheading text
-
addKeyedItem
Adds a key-value paired information item for string data.- Parameters:
name- key textvalue- value
-
addKeyedItem
Adds a key-value paired information item for Object data.- Parameters:
name- key textvalue- value
-
addKeyedItem
Adds a key-value paired information item for double data.- Parameters:
name- key textvalue- value
-
addKeyedItem
Adds a key-value paired information item for float data.- Parameters:
name- key textvalue- value
-
addKeyedItem
Adds a key-value paired information item for long data.- Parameters:
name- key textvalue- value
-
addKeyedItem
Adds a key-value paired information item for int data.- Parameters:
name- key textvalue- value
-
addKeyedItem
Adds a key-value paired information item for boolean data.- Parameters:
name- key textvalue- value
-
logError
Logs an error in supplying data in some visible fashion.- Parameters:
err- error
-
addSeparator
void addSeparator()Adds a visible separator to the display. -
addSpace
void addSpace()Adds a small amount of space to the overview display. -
addText
Adds unformatted text to the display.- Parameters:
text- text
-
addPane
Adds a component for optional display within this viewer.- Parameters:
title- title of the new componentcomp- component
-
addPane
Adds a deferred-construction component for optional display within this viewer. The component will draw itself at a fixed size and will be contained within scrollbars if necessary.- Parameters:
title- title of the new componentmaker- component deferred factory
-
addScalingPane
Adds a new deferred-construction component which will draw itself at a size appropriate to the size of its container. The JComponent returned by maker should generally have a paintComponent method which senses its actual size and draws itself accordingly, something like this:protected void paintComponent( Graphics g ) { super.paintComponent( g ); doScaledPainting( getSize() ); }or, perhaps for efficiency, more like this:private Dimension lastSize; protected void paintComponent( Graphics g ) { super.paintComponent( g ); Dimension size = getSize(); if ( ! size.equals( lastSize ) ) { setPreferredSize( size ); reconfigureComponentToSize( size ); } doPainting(); }- Parameters:
title- title of the new componentmaker- component deferred factory
-