|
||||||||
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.Box net.sourceforge.sillyview.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 inherited from class javax.swing.Box |
---|
javax.swing.Box.AccessibleBox, javax.swing.Box.Filler |
Nested classes inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
private Category |
cat
|
protected java.lang.Object |
comp
The component that the data is displayed in. |
protected javax.swing.JEditorPane |
ed
If data displayed in a JEditorPane, this is that JEditorPane. |
static int |
HTMLPANE
If you want data displayed in a HTMLPane. |
static java.lang.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 javax.swing.JLabel |
lab
If data displayed as a JLabel, this is that JLabel. |
private static int |
MIN
|
protected WidgetModel |
mod
The model this view gets its data from. |
private static int |
PREF
|
static java.lang.String |
TEXT
A token for setting the view's text. |
protected java.lang.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(java.util.Map<java.lang.Object,java.lang.Object> props)
Adds all the name/value pairs and then updates the model. |
WidgetModel |
getModel()
Returns the backing model. |
java.lang.String |
getText()
Gets this view's text. |
java.lang.Object |
getValue(java.lang.Object key)
Gets the named value. |
private void |
resizeComponent(int which,
java.awt.Dimension size)
|
void |
setAutoDump(boolean b)
If the view component is a HTMLPane, will set its autodump property. |
void |
setMinimumSize(java.awt.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(java.awt.Dimension size)
Sets the preferred size of this panel as well as the view component. |
protected void |
setText(java.lang.String txt)
Sets this views text. |
protected void |
setTitle(java.lang.String val)
Sets the panel's title to the given text, providing a titled border. |
void |
setToken(java.lang.Object key,
java.lang.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 javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final int MIN
private static final int PREF
private Category cat
protected java.lang.String title
protected javax.swing.JLabel lab
protected javax.swing.JEditorPane ed
protected java.lang.Object comp
protected WidgetModel mod
public static final java.lang.String TEXT
public static final java.lang.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
valueMethod Detail |
---|
protected void setText(java.lang.String txt)
txt
- a String
valuepublic java.lang.String getText()
String
valuepublic final void addTokens(java.util.Map<java.lang.Object,java.lang.Object> props)
addTokens
in interface WidgetView
props
- a Map
valuepublic final void setToken(java.lang.Object key, java.lang.Object value)
setToken
in interface WidgetView
key
- an Object
valuevalue
- an Object
valuepublic final java.lang.Object getValue(java.lang.Object key)
getValue
in interface WidgetView
key
- an Object
value
Object
valueprotected final void setTitle(java.lang.String val)
val
- a String
valuepublic final WidgetModel getModel()
getModel
in interface WidgetView
WidgetModel
valuepublic final void setModel(WidgetModel newModel)
setModel
in interface WidgetView
newModel
- a WidgetModel
valuepublic void setPreferredSize(java.awt.Dimension size)
setPreferredSize
in class javax.swing.JComponent
size
- a java.awt.Dimension
valueprivate void resizeComponent(int which, java.awt.Dimension size)
public void setMinimumSize(java.awt.Dimension size)
setMinimumSize
in class javax.swing.JComponent
size
- 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 |