|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.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 object on display always appears at the center of the view and takes up all available space.
The title can appear at the top or bottom of the view.
The annotation can appear at any of the four main compass directions relative to the object on display.
The valid alignment constants for the title are ABOVE, BELOW, and DEFAULT (leads to ABOVE); these constants are inherited from JPTConstants.
The valid alignment constants for the annotation are LEFT, RIGHT, ABOVE, BELOW, and DEFAULT (leads to LEFT); these constants are inherited from JPTConstants.
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.
In 2.4.0, added two contructors that provide for a title but assume no annotation. This has turned out in practice to be the most commonly used situation.
| Nested Class Summary | |
static class |
Display.Settings
Data structure encapsulating the content and layout properties for a >Display>. |
| Nested classes inherited from class javax.swing.JPanel |
JPanel.AccessibleJPanel |
| Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| 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.JPanel |
|
| 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.Container |
|
| 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, VALUE |
| 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 titleText)
Constructs a display containing the given object, with no annotation, but with the given title. |
|
Display(Displayable viewObject,
String titleText,
int titleAlign)
Constructs a display containing the given object, with no annotation, but with the given title and title alignment. |
|
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 encoded view state for the Displayable() objects in the panel. |
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 the Displayable objects in the container
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 the Displayable objects in the container
to the data encoded in the given String. |
| 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.
public Display(Displayable viewObject)
viewObject - the object to display
public Display(Displayable viewObject,
String titleText)
viewObject - the object to displaytitleText - the title text
public Display(Displayable viewObject,
String titleText,
int titleAlign)
viewObject - the object to displaytitleText - the title texttitleAlign - the relative alignment
of the title relative to the object on display
public Display(Displayable viewObject,
String annotationText,
String titleText)
viewObject - the object to displayannotationText - the annotation texttitleText - the title text
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 display
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 the
Displayable objects in the container
to the data encoded in the given String.
If the given encoded data is null,
then the view states are not changed.
The String data is decoded using the
method Strings.decode to allow the data
to be submitted in several formats.
Sets the view states of as many
Displayable objects as possible but
ignores any mismatch in the number of Displayable
objects and the number of Strings decoded from
the given encoded String data.
Fires property change VIEW_STATE.
setViewState in interface DisplayablesetViewState in class DisplayPaneldata - the encoded String datapublic String getViewState()
DisplayPanelReturns the encoded view state for the
Displayable() objects in the panel.
The encoded data is constructed by passing the
array returned by getViewStates() to
the method CodecUtilities.encode.
This method call uses the codec returned by the
method getCodec().
getViewState in interface DisplayablegetViewState in class DisplayPanelpublic void setDefaultViewState(String data)
DisplayPanelSets the default view states for the
Displayable objects in the container
to the data encoded in the given String.
If the given encoded data is null,
then the default view states are not changed.
The String data is decoded using the
method Strings.decode to allow the data
to be submitted in several formats.
Sets the default view states of as many
Displayable objects as possible but
ignores any mismatch in the number of Displayable
objects and the number of Strings decoded from
the given encoded String data.
Fires property change DEFAULT_VIEW_STATE.
setDefaultViewState in interface DisplayablesetDefaultViewState in class DisplayPaneldata - the encoded default String datapublic 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 displaypublic String getAnnotationText()
>null>
if this display does not have an annotation.
If this display does not contain an annotation,
this method returns >null>.
public void setAnnotationAlignment(int alignment)
alignment - the new alignment for the annotation
relative to the displayed objectpublic int getAnnotationAlignment()
public 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 displaypublic String getTitleText()
>null>
if this display does not have a title.
public void setTitleAlignment(int alignment)
alignment - the new alignment for the title
relative to the displayed objectpublic int getTitleAlignment()
public void setDisplay(Displayable viewObject)
>Displayable> object.
If the given object is >null>,
an empty >DisplayPanel> is created
and displayed.
viewObject - the new object to displaypublic Displayable getDisplay()
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 >Annotation>public Annotation getAnnotation()
>null>
if this display does not have an 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 | |||||||||