|
|||||||||
| 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.Box
net.sourceforge.sillyview.JPanelView
public class JPanelView
This is a central class in sillyview. It displays a given WidgetModel as a JLabel, a JEditorPane, or a HTMLPane. For implementation reasons it extends javax.swing.Box, instead of javax.swing.JPanel.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.Box |
|---|
Box.AccessibleBox, Box.Filler |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected Object |
comp
The component that the data is displayed in. |
protected JEditorPane |
ed
If data displayed in a JEditorPane, this is that JEditorPane. |
static int |
HTMLPANE
If you want data displayed in a HTMLPane. |
static String |
HYPERLINK_LISTENER
A token for setting the view's hyperlink listener. |
static int |
JEDITORPANE
If you want data displayed in a JEditorPane. |
static int |
JLABEL
If you want data displayed in a JLabel. |
protected JLabel |
lab
If data displayed as a JLabel, this is that JLabel. |
protected WidgetModel |
mod
The model this view gets its data from. |
static String |
TEXT
A token for setting the view's text. |
protected String |
title
This panel's title. |
| Fields inherited from class javax.swing.Box |
|---|
accessibleContext |
| Fields inherited from class javax.swing.JComponent |
|---|
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 net.sourceforge.sillyview.WidgetView |
|---|
FALSE, TITLE, TRUE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
JPanelView(WidgetModel model,
int componentType)
Creates a new JPanelView instance backed by the
given WidgetModel and of type JLABEL, JEDITORPANE, or HTMLPANE. |
|
| Method Summary | |
|---|---|
void |
addTokens(Map<Object,Object> props)
Adds all the name/value pairs and then updates the model. |
WidgetModel |
getModel()
Returns the backing model. |
String |
getText()
Gets this view's text. |
Object |
getValue(Object key)
Gets the named value. |
void |
setAutoDump(boolean b)
If the view component is a HTMLPane, will set its autodump property. |
void |
setMinimumSize(Dimension size)
Sets the minimum size of this panel as well as the view component. |
void |
setModel(WidgetModel newModel)
Sets the backing model. |
void |
setPreferredSize(Dimension size)
Sets the preferred size of this panel as well as the view component. |
protected void |
setText(String txt)
Sets this views text. |
protected void |
setTitle(String val)
Sets the panel's title to the given text, providing a titled border. |
void |
setToken(Object key,
Object value)
Sets the named token to the given value and then recalculates my text. |
| Methods inherited from class javax.swing.Box |
|---|
createGlue, createHorizontalBox, createHorizontalGlue, createHorizontalStrut, createRigidArea, createVerticalBox, createVerticalGlue, createVerticalStrut, getAccessibleContext, setLayout |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected String title
protected JLabel lab
protected JEditorPane ed
protected Object comp
protected WidgetModel mod
public static final String TEXT
public static final String HYPERLINK_LISTENER
public static final int JLABEL
public static final int JEDITORPANE
public static final int HTMLPANE
| Constructor Detail |
|---|
public JPanelView(WidgetModel model,
int componentType)
JPanelView instance backed by the
given WidgetModel and of type JLABEL, JEDITORPANE, or HTMLPANE.
model - a WidgetModel valuecomponentType - an int value| Method Detail |
|---|
protected void setText(String txt)
txt - a String valuepublic String getText()
String valuepublic final void addTokens(Map<Object,Object> props)
addTokens in interface WidgetViewprops - a Map value
public final void setToken(Object key,
Object value)
setToken in interface WidgetViewkey - an Object valuevalue - an Object valuepublic final Object getValue(Object key)
getValue in interface WidgetViewkey - an Object value
Object valueprotected final void setTitle(String val)
val - a String valuepublic final WidgetModel getModel()
getModel in interface WidgetViewWidgetModel valuepublic final void setModel(WidgetModel newModel)
setModel in interface WidgetViewnewModel - a WidgetModel valuepublic void setPreferredSize(Dimension size)
setPreferredSize in class JComponentsize - a java.awt.Dimension valuepublic void setMinimumSize(Dimension size)
setMinimumSize in class JComponentsize - a java.awt.Dimension valuepublic void setAutoDump(boolean b)
b - a boolean value
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||