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 TypeMethodDescriptionvoid
addKeyedItem
(String name, boolean value) Adds a key-value paired information item for boolean data.void
addKeyedItem
(String name, double value) Adds a key-value paired information item for double data.void
addKeyedItem
(String name, float value) Adds a key-value paired information item for float data.void
addKeyedItem
(String name, int value) Adds a key-value paired information item for int data.void
addKeyedItem
(String name, long value) Adds a key-value paired information item for long data.void
addKeyedItem
(String name, Object value) Adds a key-value paired information item for Object data.void
addKeyedItem
(String name, String value) Adds a key-value paired information item for string data.void
Adds a component for optional display within this viewer.void
addPane
(String title, ComponentMaker maker) Adds a deferred-construction component for optional display within this viewer.void
addScalingPane
(String title, ComponentMaker maker) Adds a new deferred-construction component which will draw itself at a size appropriate to the size of its container.void
Adds a visible separator to the display.void
addSpace()
Adds a small amount of space to the overview display.void
addSubHead
(String text) Adds a subheading to the display.void
Adds unformatted text to the display.void
Adds a top-level title to the display.void
Logs 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
-