|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.JPanel
|
+--edu.neu.ccs.gui.DisplayPanel
|
+--edu.neu.ccs.gui.Display
A panel containing a
object,
with the option of a title and an
Displayable.Annotation
The title can appear at the top or bottom of the view. The object on display always appears at the center of the view and takes up all available space. The annotation can appear at any of the four main compass directions relative to the object on display.
The functionality of this container assumes use of a
and effects are undefined if the user changes this layout.BorderLayout
The Display is the simplest and most versatile
of the recursive container classes available in the JPT.
Displays can be recursively nested to any depth,
although screen real estate imposes a physical limit
to the number of displays that could be contained
within an actual visualization.
Annotation,
Displayable,
Serialized Form| Nested Class Summary | |
static class |
Display.Settings
Data structure encapsulating the content and layout properties for a Display. |
| Field Summary | |
protected int |
aAlign
The alignment of the annotation relative to displayed object. |
static String |
ANNOTATION
Bound property name for the annotation object property. |
static String |
ANNOTATION_ALIGNMENT
Bound property name for the annotation alignment property. |
static String |
ANNOTATION_TEXT
Bound property name for the annotation text property. |
protected Annotation |
caption
The annotation for this display. |
static int |
DEFAULT_ANNOTATION_ALIGNMENT
The default alignment of the annotation relative to displayed object for a display. |
static String |
DEFAULT_ANNOTATION_TEXT
The default annotation text for a display. |
static int |
DEFAULT_TITLE_ALIGNMENT
The default alignment of the title relative to displayed object. |
static String |
DEFAULT_TITLE_TEXT
The default title text for a display. |
static String |
DISPLAY
Bound property name for the displayed object property. |
protected int |
tAlign
The alignment of the title relative to displayed object. |
protected String |
title
The title text for this display. |
static String |
TITLE_ALIGNMENT
Bound property name for the title alignment property. |
static String |
TITLE_TEXT
Bound property name for the title text property. |
protected Displayable |
view
The displayed object for this display. |
| Fields inherited from class edu.neu.ccs.gui.DisplayPanel |
background, codec, CODEC |
| Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface edu.neu.ccs.gui.Displayable |
DEFAULT_VIEW_STATE, VIEW_STATE |
| Fields inherited from interface edu.neu.ccs.util.JPTConstants |
ABOVE, ALIGNMENT, BELOW, BOTTOM_LEFT, BOTTOM_RIGHT, DEFAULT, FONT, INPUT_PROPERTIES, MANDATORY, OPTIONAL, ORIENTATION, TOP_LEFT, TOP_RIGHT |
| Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
Display()
Constructs a display containing an empty DisplayPanel,
with no annotation or title. |
|
Display(Displayable viewObject)
Constructs a display containing the given object, with no annotation or title. |
|
Display(Displayable viewObject,
Display.Settings settings)
Constructs a display containing the given object, with the remaining settings taken from the given Settings object. |
|
Display(Displayable viewObject,
String annotationText,
String titleText)
Constructs a display containing the given object, with the given annotation text and title text. |
|
Display(Displayable viewObject,
String annotationText,
String titleText,
int annotationAlign,
int titleAlign)
Constructors a display containing the given object, with the given annotation text and title text, using the given alignments for the title and annotation. |
|
| Method Summary | |
Annotation |
getAnnotation()
Returns the annotation component, or null
if this display does not have an annotation. |
int |
getAnnotationAlignment()
Returns the value for the alignment of the annotation relative to the displayed object. |
String |
getAnnotationText()
Returns the annotation text, or null
if this display does not have an annotation. |
Displayable |
getDisplay()
Returns the displayed object. |
Display.Settings |
getSettings()
Returns the properties for this display as a Settings object. |
int |
getTitleAlignment()
Returns the alignment value of the title relative to the object on display. |
String |
getTitleText()
Returns the title text, or null
if this display does not have a title. |
String |
getViewState()
Returns the view states for objects in the container as an encoded String. |
protected void |
revalidateAnnotationAndAlignment()
Rebuilds the annotation and its alignment based on the current annotation text and alignment. |
protected void |
revalidateTitleAndAlignment()
Rebuilds the titled border and its alignment based on the current title text and alignment. |
void |
setAnnotation(Annotation annotation)
Sets the annotation component to the given Annotation. |
void |
setAnnotationAlignment(int alignment)
Sets the alignment of the annotation relative to the displayed object. |
void |
setAnnotationText(String text)
Sets the annotation text to the given text. |
void |
setDefaultViewState(String data)
Sets the default view states for objects in the collection to the data encoded in the given String. |
void |
setDisplay(Displayable viewObject)
Sets the displayed object to the given Displayable object. |
void |
setSettings(Display.Settings s)
Sets the properties for this display to the settings taken from the given Settings object. |
void |
setTitleAlignment(int alignment)
Sets the alignment of the title relative to the displayed object. |
void |
setTitleText(String text)
Sets the title text to the given text. |
void |
setViewState(String data)
Sets the view states for Displayable objects in the container
to the data encoded in the given String. |
| Methods inherited from class edu.neu.ccs.gui.DisplayPanel |
add, add, add, add, add, addObject, addObject, addObject, addObject, dataMalformed, endAlert, frame, frame, frame, frame, frame, frame, generalDialog, generalDialog, generalDialog, generalDialog, getCodec, getDefaultViewState, makeComponent, OKCancelDialog, OKCancelDialog, OKDialog, OKDialog, refreshComponent, remove, remove, removeAll, reset, setCodec, setEnabled, startAlert, uniformizeHeight, uniformizeSize, uniformizeWidth, YesNoCancelDialog, YesNoCancelDialog |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final String ANNOTATION_TEXT
public static final String ANNOTATION_ALIGNMENT
public static final String TITLE_TEXT
public static final String TITLE_ALIGNMENT
public static final String DISPLAY
public static final String ANNOTATION
public static final String DEFAULT_ANNOTATION_TEXT
public static final String DEFAULT_TITLE_TEXT
public static final int DEFAULT_ANNOTATION_ALIGNMENT
public static final int DEFAULT_TITLE_ALIGNMENT
protected String title
protected int aAlign
protected int tAlign
protected Displayable view
null,
an empty DisplayPanel will be provided
on any attempt to set a null displayed object.
protected Annotation caption
| Constructor Detail |
public Display()
DisplayPanel,
with no annotation or title.
Display(Displayable),
Display(Displayable, String, String),
Display(Displayable, String, String, int, int)public Display(Displayable viewObject)
viewObject - the object to displayDisplay(),
Display(Displayable, String, String),
Display(Displayable, String, String, int, int)
public Display(Displayable viewObject,
String annotationText,
String titleText)
viewObject - the object to displayannotationText - the annotation texttitleText - the title textDisplay(),
Display(Displayable),
Display(Displayable, String, String, int, int)
public Display(Displayable viewObject,
String annotationText,
String titleText,
int annotationAlign,
int titleAlign)
viewObject - the object to displayannotationText - the annotation texttitleText - the title textannotationAlign - the relative alignment
of the annotation relative to the object on displaytitleAlign - the relative alignment
of the title relative to the object on displayDisplay(),
Display(Displayable),
Display(Displayable, String, String)
public Display(Displayable viewObject,
Display.Settings settings)
Settings object.
viewObject - the object to displaysettings - the object containing the desired settings| Method Detail |
public void setViewState(String data)
DisplayPanelSets the view states for
Displayable objects in the container
to the data encoded in the given String.
If the given encoded data is null,
the view states are not changed.
null,
the data is decoded into its component data elements
and the view state for each of as many
Displayable objects as possible
is set to the state encapsulated in the corresponding
data element.
If the encoded data contains more data elements
than there are Displayable objects in the panel,
the extraneous data elements are ignored.
If the encoded data contains fewer data elements
than there are Displayable objects in the panel,
the view states are not changed for objects that
do not have a corresponding data element.
setViewState in interface DisplayablesetViewState in class DisplayPaneldata - the encoded String dataDisplayPanel.getViewState(),
Displayablepublic String getViewState()
DisplayPanelString.
The encoded data is constructed by collecting an array
containing the view states for each of the
Displayable objects in the container
and encoding it using the CODEC whose identifier
is stored by this panel.
getViewState in interface DisplayablegetViewState in class DisplayPanelDisplayPanel.setViewState(String),
Displayablepublic void setDefaultViewState(String data)
DisplayPanelString.
If the given encoded data is null,
the default view states are not changed.
null,
the data is decoded into its component data elements
and the default view state for each of as many
Displayable objects as possible
is set to the state encapsulated in the corresponding
data element.
If the encoded data contains more data elements
than there are Displayable objects in the panel,
the extraneous data elements are ignored.
If the encoded data contains fewer data elements
than there are Displayable objects in the panel,
the default view states are not changed for objects that
do not have a corresponding data element.
setDefaultViewState in interface DisplayablesetDefaultViewState in class DisplayPaneldata - the desired default String dataDisplayPanel.reset(),
Displayablepublic void setAnnotationText(String text)
null,
the current annotation is removed from this display
an no annotation is displayed.
If the annotation text was previously null,
a new Annotation object is created.
text - the annotation text to displaygetAnnotationText()public String getAnnotationText()
null
if this display does not have an annotation.
If this display does not contain an annotation,
this method returns null.
setAnnotationText(String)public void setAnnotationAlignment(int alignment)
alignment - the new alignment for the annotation
relative to the displayed objectgetAnnotationAlignment(),
JPTConstants.ABOVE,
JPTConstants.BELOW,
SwingConstants.LEFT,
SwingConstants.RIGHT,
JPTConstants.DEFAULTpublic int getAnnotationAlignment()
setAnnotationAlignment(int),
JPTConstants.ABOVE,
JPTConstants.BELOW,
SwingConstants.LEFT,
SwingConstants.RIGHTpublic void setTitleText(String text)
null,
the current titled border is removed from this display
and no title is displayed.
If the title text was previously null,
a new titled border is created.
text - the title text to displaygetTitleText()public String getTitleText()
null
if this display does not have a title.
setTitleText(String)public void setTitleAlignment(int alignment)
alignment - the new alignment for the title
relative to the displayed objectgetTitleAlignment(),
JPTConstants.ABOVE,
JPTConstants.BELOW,
JPTConstants.DEFAULTpublic int getTitleAlignment()
setTitleAlignment(int),
JPTConstants.ABOVE,
JPTConstants.BELOWpublic void setDisplay(Displayable viewObject)
Displayable object.
If the given object is null,
an empty DisplayPanel is created
and displayed.
viewObject - the new object to displaygetDisplay()public Displayable getDisplay()
setDisplay(Displayable)public void setAnnotation(Annotation annotation)
Annotation.
If the given object is null,
the current annotation is removed from this display
and no annotation is displayed.
annotation - the new AnnotationgetAnnotation()public Annotation getAnnotation()
null
if this display does not have an annotation.
setAnnotation(Annotation)public void setSettings(Display.Settings s)
Settings object.
If the given object is null,
then all settings are reset to defaults.
s - encapsulation of the new settings for this displaypublic Display.Settings getSettings()
Settings object.
protected void revalidateTitleAndAlignment()
protected void revalidateAnnotationAndAlignment()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||