|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.millstone.base.ui.AbstractComponent | +--org.millstone.base.ui.AbstractComponentContainer | +--org.millstone.base.ui.Panel
Panel - a simple single component container.
Nested Class Summary |
Nested classes inherited from class org.millstone.base.ui.ComponentContainer |
ComponentContainer.ComponentAttachEvent, ComponentContainer.ComponentAttachListener, ComponentContainer.ComponentDetachEvent, ComponentContainer.ComponentDetachListener |
Nested classes inherited from class org.millstone.base.ui.Component |
Component.Event, Component.Listener |
Nested classes inherited from class org.millstone.base.terminal.Paintable |
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener |
Field Summary |
Fields inherited from interface org.millstone.base.terminal.Sizeable |
UNIT_SYMBOLS, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS |
Constructor Summary | |
Panel()
Create new empty panel. |
|
Panel(Layout layout)
Create new empty panel with given layout. |
|
Panel(java.lang.String caption)
Create new empty panel with caption. |
|
Panel(java.lang.String caption,
Layout layout)
Create new empty panel with caption. |
Method Summary | |
void |
addComponent(Component c)
Add a component into this container. |
void |
changeVariables(java.lang.Object source,
java.util.Map variables)
Called when one or more variables handled by the implementing class are changed. |
void |
componentAttachedToContainer(ComponentContainer.ComponentAttachEvent event)
Pass the events from underlying layout forwards. |
void |
componentDetachedFromContainer(ComponentContainer.ComponentDetachEvent event)
Pass the events from underlying layout forwards. |
java.util.Iterator |
getComponentIterator()
Get component container iterator for going trough all the components in the container. |
int |
getHeight()
Get height of the object. |
int |
getHeightUnits()
Get height property units. |
Layout |
getLayout()
Get the current layout of the panel. |
int |
getScrollOffsetX()
Get scroll X offset. |
int |
getScrollOffsetY()
Get scroll Y offset. |
java.lang.String |
getTag()
Get component UIDL tag. |
int |
getWidth()
Get width of the object. |
int |
getWidthUnits()
Get width property units. |
boolean |
isScrollable()
Is the scrolling enabled. |
void |
paintContent(PaintTarget target)
Paint the content of this component. |
void |
removeComponent(Component c)
Remove a component from this container. |
void |
replaceComponent(Component oldComponent,
Component newComponent)
Replace a component in the container with another one without changing position. |
void |
setHeight(int height)
Sets the height in pixels. |
void |
setHeightUnits(int units)
Set height units. |
void |
setLayout(Layout layout)
Set the layout of the panel. |
void |
setScrollable(boolean isScrollingEnabled)
Enable or disable scrolling.. |
void |
setScrollOffsetX(int pixelsScrolledLeft)
Set scroll X offset. |
void |
setScrollOffsetY(int pixelsScrolledDown)
Set scroll Y offset. |
void |
setWidth(int width)
Sets the width in pixels. |
void |
setWidthUnits(int units)
Set width units. |
Methods inherited from class org.millstone.base.ui.AbstractComponentContainer |
addListener, addListener, attach, detach, fireComponentAttachEvent, fireComponentDetachEvent, moveComponentsFrom, removeAllComponents, removeListener, removeListener |
Methods inherited from class org.millstone.base.ui.AbstractComponent |
addListener, addListener, addListener, addListener, childRequestedRepaint, dependsOn, fireComponentEvent, fireEvent, getApplication, getCaption, getComponentError, getDescription, getDirectDependencies, getErrorMessage, getIcon, getLocale, getParent, getStyle, getWindow, isEnabled, isImmediate, isReadOnly, isVisible, paint, removeDirectDependency, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setDescription, setEnabled, setIcon, setImmediate, setLocale, setParent, setReadOnly, setStyle, setVisible |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.millstone.base.ui.Component |
addListener, childRequestedRepaint, getApplication, getCaption, getIcon, getLocale, getParent, getStyle, getWindow, isEnabled, isImmediate, isReadOnly, isVisible, removeListener, setEnabled, setParent, setReadOnly, setStyle, setVisible |
Methods inherited from interface org.millstone.base.terminal.Paintable |
addListener, paint, removeListener, requestRepaint, requestRepaintRequests |
Methods inherited from interface org.millstone.base.terminal.VariableOwner |
dependsOn, getDirectDependencies, removeDirectDependency |
Constructor Detail |
public Panel()
public Panel(Layout layout)
layout
- The layout used in the panel.public Panel(java.lang.String caption)
caption
- The caption used in the panel.public Panel(java.lang.String caption, Layout layout)
caption
- The caption of the panel.layout
- The layout used in the panel.Method Detail |
public Layout getLayout()
public void setLayout(Layout layout)
layout
- New layout of the panel.public void paintContent(PaintTarget target) throws PaintException
paintContent
in class AbstractComponent
target
- target UIDL stream where the component should paint
itself to
PaintException
- The paint operation failed.public java.lang.String getTag()
getTag
in class AbstractComponent
public void addComponent(Component c)
addComponent
in interface ComponentContainer
addComponent
in class AbstractComponentContainer
c
- The component to be added.ComponentContainer.addComponent(Component)
public void removeComponent(Component c)
removeComponent
in interface ComponentContainer
removeComponent
in class AbstractComponentContainer
c
- The component to be added.ComponentContainer.removeComponent(Component)
public java.util.Iterator getComponentIterator()
getComponentIterator
in interface ComponentContainer
public int getHeight()
Sizeable
getHeight
in interface Sizeable
public int getWidth()
Sizeable
getWidth
in interface Sizeable
public void setHeight(int height)
setHeight
in interface Sizeable
height
- The height to setpublic void setWidth(int width)
setWidth
in interface Sizeable
width
- The width to setpublic void changeVariables(java.lang.Object source, java.util.Map variables)
VariableOwner
changeVariables
in interface VariableOwner
changeVariables
in class AbstractComponent
source
- Source of the variable change. This is the origin of the
event. For example in Web Adapter this is the request.variables
- Mapping from variable names to new variable valuesVariableOwner.changeVariables(Object, Map)
public int getHeightUnits()
Sizeable
getHeightUnits
in interface Sizeable
Sizeable.getHeightUnits()
public int getWidthUnits()
Sizeable
getWidthUnits
in interface Sizeable
Sizeable.getWidthUnits()
public void setHeightUnits(int units)
setHeightUnits
in interface Sizeable
units
- units used in height property.millstone.base.terminal.Sizeable#setHeightUnits(int)
public void setWidthUnits(int units)
setWidthUnits
in interface Sizeable
units
- units used in width property.Sizeable.setWidthUnits(int)
public int getScrollOffsetX()
Scrollable
Scrolling offset is the number of pixels this scrollable has been scrolled to left.
getScrollOffsetX
in interface Scrollable
public int getScrollOffsetY()
Scrollable
Scrolling offset is the number of pixels this scrollable has been scrolled to down.
getScrollOffsetY
in interface Scrollable
public boolean isScrollable()
Scrollable
Enabling scrolling allows the user to scroll the scrollable view interactively
isScrollable
in interface Scrollable
public void setScrollable(boolean isScrollingEnabled)
Scrollable
Enabling scrolling allows the user to scroll the scrollable view interactively
setScrollable
in interface Scrollable
isScrollingEnabled
- True iff the scrolling is allowed.public void setScrollOffsetX(int pixelsScrolledLeft)
Scrollable
Scrolling offset is the number of pixels this scrollable has been scrolled to left.
setScrollOffsetX
in interface Scrollable
public void setScrollOffsetY(int pixelsScrolledDown)
Scrollable
Scrolling offset is the number of pixels this scrollable has been scrolled to down.
setScrollOffsetY
in interface Scrollable
public void replaceComponent(Component oldComponent, Component newComponent)
ComponentContainer
This method replaces component with another one is such way that the new component overtakes the position of the old component. If the old component is not in the container, the new component is added to the container. If the both component are already in the container, their positions are swapped. Component attach and detach events should be taken care as with add and remove.
replaceComponent
in interface ComponentContainer
oldComponent
- The old component that will be replaced.newComponent
- The new component to be replacedpublic void componentAttachedToContainer(ComponentContainer.ComponentAttachEvent event)
componentAttachedToContainer
in interface ComponentContainer.ComponentAttachListener
ComponentContainer.ComponentAttachListener.componentAttachedToContainer(org.millstone.base.ui.ComponentContainer.ComponentAttachEvent)
public void componentDetachedFromContainer(ComponentContainer.ComponentDetachEvent event)
componentDetachedFromContainer
in interface ComponentContainer.ComponentDetachListener
ComponentContainer.ComponentDetachListener.componentDetachedFromContainer(org.millstone.base.ui.ComponentContainer.ComponentDetachEvent)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |