Package uk.ac.starlink.datanode.nodes
Interface DetailViewer
-
public interface DetailViewerDefines 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddKeyedItem(java.lang.String name, boolean value)Adds a key-value paired information item for boolean data.voidaddKeyedItem(java.lang.String name, double value)Adds a key-value paired information item for double data.voidaddKeyedItem(java.lang.String name, float value)Adds a key-value paired information item for float data.voidaddKeyedItem(java.lang.String name, int value)Adds a key-value paired information item for int data.voidaddKeyedItem(java.lang.String name, long value)Adds a key-value paired information item for long data.voidaddKeyedItem(java.lang.String name, java.lang.Object value)Adds a key-value paired information item for Object data.voidaddKeyedItem(java.lang.String name, java.lang.String value)Adds a key-value paired information item for string data.voidaddPane(java.lang.String title, java.awt.Component comp)Adds a component for optional display within this viewer.voidaddPane(java.lang.String title, ComponentMaker maker)Adds a deferred-construction component for optional display within this viewer.voidaddScalingPane(java.lang.String title, ComponentMaker maker)Adds a new deferred-construction component which will draw itself at a size appropriate to the size of its container.voidaddSeparator()Adds a visible separator to the display.voidaddSpace()Adds a small amount of space to the overview display.voidaddSubHead(java.lang.String text)Adds a subheading to the display.voidaddText(java.lang.String text)Adds unformatted text to the display.voidaddTitle(java.lang.String title)Adds a top-level title to the display.voidlogError(java.lang.Throwable err)Logs an error in supplying data in some visible fashion.
-
-
-
Method Detail
-
addTitle
void addTitle(java.lang.String title)
Adds a top-level title to the display.- Parameters:
title- title text
-
addSubHead
void addSubHead(java.lang.String text)
Adds a subheading to the display.- Parameters:
text- subheading text
-
addKeyedItem
void addKeyedItem(java.lang.String name, java.lang.String value)Adds a key-value paired information item for string data.- Parameters:
name- key textvalue- value
-
addKeyedItem
void addKeyedItem(java.lang.String name, java.lang.Object value)Adds a key-value paired information item for Object data.- Parameters:
name- key textvalue- value
-
addKeyedItem
void addKeyedItem(java.lang.String name, double value)Adds a key-value paired information item for double data.- Parameters:
name- key textvalue- value
-
addKeyedItem
void addKeyedItem(java.lang.String name, float value)Adds a key-value paired information item for float data.- Parameters:
name- key textvalue- value
-
addKeyedItem
void addKeyedItem(java.lang.String name, long value)Adds a key-value paired information item for long data.- Parameters:
name- key textvalue- value
-
addKeyedItem
void addKeyedItem(java.lang.String name, int value)Adds a key-value paired information item for int data.- Parameters:
name- key textvalue- value
-
addKeyedItem
void addKeyedItem(java.lang.String name, boolean value)Adds a key-value paired information item for boolean data.- Parameters:
name- key textvalue- value
-
logError
void logError(java.lang.Throwable err)
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
void addText(java.lang.String text)
Adds unformatted text to the display.- Parameters:
text- text
-
addPane
void addPane(java.lang.String title, java.awt.Component comp)Adds a component for optional display within this viewer.- Parameters:
title- title of the new componentcomp- component
-
addPane
void addPane(java.lang.String title, ComponentMaker maker)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
void addScalingPane(java.lang.String title, ComponentMaker maker)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
-
-