public interface DetailViewer
Modifier and Type | Method and Description |
---|---|
void |
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 |
addPane(String title,
Component comp)
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 |
addSeparator()
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 |
addText(String text)
Adds unformatted text to the display.
|
void |
addTitle(String title)
Adds a top-level title to the display.
|
void |
logError(Throwable err)
Logs an error in supplying data in some visible fashion.
|
void addTitle(String title)
title
- title textvoid addSubHead(String text)
text
- subheading textvoid addKeyedItem(String name, String value)
name
- key textvalue
- valuevoid addKeyedItem(String name, Object value)
name
- key textvalue
- valuevoid addKeyedItem(String name, double value)
name
- key textvalue
- valuevoid addKeyedItem(String name, float value)
name
- key textvalue
- valuevoid addKeyedItem(String name, long value)
name
- key textvalue
- valuevoid addKeyedItem(String name, int value)
name
- key textvalue
- valuevoid addKeyedItem(String name, boolean value)
name
- key textvalue
- valuevoid logError(Throwable err)
err
- errorvoid addSeparator()
void addSpace()
void addText(String text)
text
- textvoid addPane(String title, Component comp)
title
- title of the new componentcomp
- componentvoid addPane(String title, ComponentMaker maker)
title
- title of the new componentmaker
- component deferred factoryvoid addScalingPane(String title, ComponentMaker maker)
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(); }
title
- title of the new componentmaker
- component deferred factoryCopyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.