Class sgraphics.SgraphicsAdapter
All Packages Class Hierarchy This Package Previous Next Index
Class sgraphics.SgraphicsAdapter
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----sgraphics.SgraphicsAdapter
- public class SgraphicsAdapter
- extends Panel
The SgraphicsAdapter connects a glyph tree to AWT. A TopViewer is inserted
between the top glyph and the adapter to handle events. SgraphicsAdapter
handles double buffering for the tree.
-
SgraphicsAdapter(Glyph)
- Create an adapter between an AWT Container and a glyph tree.
-
SgraphicsAdapter(Glyph, boolean, boolean)
-
Create an adapter between an awt Component and a glyph tree.
-
disableDrawing()
-
-
doubleBuffering()
- Check if double buffering is on.
-
doubleBuffering(boolean)
- Set the double buffer.
-
enableDrawing()
-
-
getPainter()
- Gets a painter object.
-
minimumSize()
- Get the minimum size.
-
needRedraw()
- Redraws all glyphs by calling repaint().
-
needRedraw(Area)
- Redraws all glyphs overlapping the area.
-
needResize()
- Forces geometry calculation and redraws all glyphs.
-
paint(Graphics)
-
Paints the component.
-
postEvent(Event)
- Posts an event to the top viewer and if it does not handle the event it calls the parent
class which passes the event to the parent container.
-
postEvent(GraphicsEvent)
- Post a new GraphicsEvent.
-
preferredSize()
- Get the preferred size.
-
refresh()
- Force the buffer to copy to the screen.
-
removeOrphanWidgets()
- For internal use by widgets.
-
reshape(int, int, int, int)
-
Reshapes the Component to the specified bounding box.
-
setTopGlyph(Glyph)
- Used to change the top glyph after construction.
-
update(Graphics)
-
Updates the component.
SgraphicsAdapter
public SgraphicsAdapter(Glyph glyph)
- Create an adapter between an AWT Container and a glyph tree.
By default, SgraphicsAdapter is not double buffered and update
clears the background before painting.
- Parameters:
- glyph - the root of the glyph tree.
SgraphicsAdapter
public SgraphicsAdapter(Glyph glyph,
boolean buffer,
boolean override)
- Create an adapter between an awt Component and a glyph tree.
By default, SgraphicsAdapter is not double buffered and update
clears the background before painting.
- Parameters:
- glyph - the root of the glyph tree.
- buffer - if true then double buffer the glyph tree.
- override - if true then update() does not clear the background
before painting.
minimumSize
public Dimension minimumSize()
- Get the minimum size. The minimum size is determined from the top glyph's minimum size.
- Returns:
- the minimum size.
- Overrides:
- minimumSize in class Container
preferredSize
public Dimension preferredSize()
- Get the preferred size. The preferred size is determined from the top glyph's natural size.
- Returns:
- the preferred size.
- Overrides:
- preferredSize in class Container
reshape
public synchronized void reshape(int x,
int y,
int width,
int height)
- Reshapes the Component to the specified bounding box.
- Overrides:
- reshape in class Component
postEvent
public boolean postEvent(Event event)
- Posts an event to the top viewer and if it does not handle the event it calls the parent
class which passes the event to the parent container.
- Parameters:
- event - the event.
- Returns:
- true if the event is handled.
- Overrides:
- postEvent in class Component
postEvent
public boolean postEvent(GraphicsEvent event)
- Post a new GraphicsEvent. If it is not handled, it is passed to the parent
container. A decendent viewer can use this call to introduce an
event to the system. If an event is already being processed by this method
or postEvent(Event) the event is placed on a queue and false is returned.
Queued events are processed after any current event processing is complete.
- Parameters:
- event - the new event.
- Returns:
- true if the event is handled.
update
public void update(Graphics g)
- Updates the component.
- Overrides:
- update in class Component
refresh
public void refresh()
- Force the buffer to copy to the screen. The purpose of this is to
call disableDrawing(), draw some things, call enableDrawing(),
then finally call refresh() to update the screen. If this
is called when not double buffering, nothing happens.
paint
public void paint(Graphics g)
- Paints the component.
- Overrides:
- paint in class Component
setTopGlyph
public void setTopGlyph(Glyph glyph)
- Used to change the top glyph after construction.
removeOrphanWidgets
public void removeOrphanWidgets()
- For internal use by widgets. Not for normal use.
needRedraw
public void needRedraw()
- Redraws all glyphs by calling repaint().
needRedraw
public void needRedraw(Area area)
- Redraws all glyphs overlapping the area. If area is null
needRedraw() is called. Do not call this from the "main"
thread or you will get an IllegalMonitorException.
- Parameters:
- area - the area that needs redrawing.
needResize
public void needResize()
- Forces geometry calculation and redraws all glyphs.
getPainter
public Painter getPainter()
- Gets a painter object. If you use this, you will bypass any
double buffering.
disableDrawing
public void disableDrawing()
enableDrawing
public void enableDrawing()
doubleBuffering
public boolean doubleBuffering()
- Check if double buffering is on.
- Returns:
- true if double buffering.
doubleBuffering
public void doubleBuffering(boolean enable)
- Set the double buffer. This will not clear an existing buffer.
- Parameters:
- enable - true enables double buffering.
All Packages Class Hierarchy This Package Previous Next Index