| javax.swing.JComponent prefuse.Display
All known Subclasses: prefuse.demos.RadialGraphView, prefuse.demos.ScatterPlot, prefuse.demos.FisheyeMenu, prefuse.demos.DataMountain, prefuse.demos.TreeView, prefuse.demos.TreeMap, prefuse.demos.ZipDecode, prefuse.demos.AggregateDemo,
Constructor Summary | |
public | Display() Creates a new Display instance. | public | Display(Visualization visualization) Creates a new Display associated with the given Visualization. | public | Display(Visualization visualization, String predicate) Creates a new Display associated with the given Visualization that
draws all VisualItems in the visualization that pass the given
Predicate. | public | Display(Visualization visualization, Predicate predicate) Creates a new Display associated with the given Visualization that
draws all VisualItems in the visualization that pass the given
Predicate. |
Method Summary | |
public void | addControlListener(Control cl) Adds a ControlListener to receive all input events on VisualItems. | public void | addItemBoundsListener(ItemBoundsListener ibl) Add an ItemBoundsListener to receive notifications when the bounds
occupied by the VisualItems in this Display change. | public void | addPaintListener(PaintListener pl) Add a PaintListener to this Display to receive notifications
about paint events. | public synchronized void | animatePan(double dx, double dy, long duration) Animate a pan along the specified distance in screen (pixel)
co-ordinates using the provided duration. | public synchronized void | animatePanAbs(double dx, double dy, long duration) Animate a pan along the specified distance in absolute (item-space)
co-ordinates using the provided duration. | public synchronized void | animatePanAndZoomTo(Point2D p, double scale, long duration) Animate a pan to the specified location in screen (pixel)
co-ordinates and zoom to the given scale using the provided duration. | public synchronized void | animatePanAndZoomToAbs(Point2D p, double scale, long duration) Animate a pan to the specified location in absolute (item-space)
co-ordinates and zoom to the given scale using the provided duration. | public synchronized void | animatePanTo(Point2D p, long duration) Animate a pan to the specified location in screen (pixel)
co-ordinates using the provided duration. | public synchronized void | animatePanToAbs(Point2D p, long duration) Animate a pan to the specified location in absolute (item-space)
co-ordinates using the provided duration. | public synchronized void | animateZoom(Point2D p, double scale, long duration) Animate a zoom centered on a given location in screen (pixel)
co-ordinates by the given scale using the provided duration. | public synchronized void | animateZoomAbs(Point2D p, double scale, long duration) Animate a zoom centered on a given location in absolute (item-space)
co-ordinates by the given scale using the provided duration. | protected void | checkItemBoundsChanged(Rectangle2D prev) Check if the item bounds has changed, and if so, fire a notification. | public synchronized void | clearDamage() Clears any reports of damaged regions, causing the Display to believe
that the display contents are up-to-date. | protected void | clearRegion(Graphics2D g, Rectangle2D r) Clears the specified region of the display
in the display's offscreen buffer. | public JToolTip | createToolTip() Returns the tooltip instance to use for this Display. | public synchronized void | damageReport(Rectangle2D region) Reports damage to the Display within in the specified region. | public synchronized void | damageReport() Reports damage to the entire Display. | public void | editText(VisualItem item, String attribute) Edit text for the given VisualItem and attribute. | public void | editText(VisualItem item, String attribute, Rectangle r) Edit text for the given VisualItem and field. | public void | editText(String txt, Rectangle r) Show a text editing widget containing the given text and spanning the
specified bounding box. | public synchronized VisualItem | findItem(Point p) Returns the VisualItem located at the given point. | protected void | firePostPaint(Graphics2D g) Fires a post-paint notification to PaintListeners. | protected void | firePrePaint(Graphics2D g) Fires a pre-paint notification to PaintListeners. | public Point2D | getAbsoluteCoordinate(Point2D screen, Point2D abs) Gets the absolute co-ordinate corresponding to the given screen
co-ordinate.
Parameters: screen - the screen co-ordinate to transform Parameters: abs - a reference to put the result in. | public JToolTip | getCustomToolTip() Get the custom tooltip used by this Display. | public double | getDisplayX() Returns the x-coordinate of the top-left of the display,
in absolute (item-space) co-ordinates. | public double | getDisplayY() Returns the y-coordinate of the top-left of the display,
in absolute (item-space) co-ordinates. | public double | getFrameRate() Returns the running average frame rate for this Display. | public AffineTransform | getInverseTransform() Returns a reference to the inverse of the AffineTransformation used by
this display. | public synchronized Rectangle2D | getItemBounds() Returns the bounds, in absolute (item-space) coordinates, of the total
bounds occupied by all currently visible VisualItems. | public synchronized Rectangle2D | getItemBounds(Rectangle2D b) Returns the bounds, in absolute (item-space) coordinates, of the total
bounds occupied by all currently visible VisualItems. | public ItemSorter | getItemSorter() Get the ItemSorter that determines the rendering order of the
VisualItems. | protected BufferedImage | getNewOffscreenBuffer(int width, int height) Creates a new buffered image to use as an offscreen buffer. | public BufferedImage | getOffscreenBuffer() Returns the offscreen buffer used for double buffering. | public Predicate | getPredicate() Returns the filtering Predicate used to control what items are drawn
by this display. | public double | getScale() Returns the current scale (zoom) value.
the current scale. | public JTextComponent | getTextEditor() Returns the TextComponent used for on-screen text editing. | public AffineTransform | getTransform() Returns a reference to the AffineTransformation used by this Display.
Changes made to this reference WILL corrupt the state of
this display. | public int | getVisibleItemCount() Returns the number of visible items processed by this Display. | public Visualization | getVisualization() Returns the Visualization backing this Display. | public void | invalidate() Invalidates this component. | public synchronized boolean | isDamageRedraw() Indicates if damage/redraw rendering is enabled. | public boolean | isHighQuality() Indicates if the Display is using high quality (return value true) or
regular quality (return value false) rendering. | public boolean | isTranformInProgress() Indicates if a view transformation is currently underway. | protected void | paintBufferToScreen(Graphics g) Paints the offscreen buffer to the provided graphics context. | public void | paintComponent(Graphics g) | public void | paintDisplay(Graphics2D g2D, Dimension d) Renders the display within the given graphics context and size bounds. | public synchronized void | pan(double dx, double dy) Pans the view provided by this display in screen coordinates. | public synchronized void | panAbs(double dx, double dy) Pans the view provided by this display in absolute (i.e. | public synchronized void | panTo(Point2D p) Pans the display view to center on the provided point in
screen (pixel) coordinates. | public synchronized void | panToAbs(Point2D p) Pans the display view to center on the provided point in
absolute (i.e. | protected void | prepareGraphics(Graphics2D g) Sets the transform of the provided Graphics context to be the
transform of this Display and sets the desired rendering hints. | protected void | printComponent(Graphics g) Paints the graph to the provided graphics context, for output to a
printer. | protected void | registerDefaultCommands() Registers default keystroke commands on the Display. | public void | removeControlListener(Control cl) Removes a registered ControlListener. | public void | removeItemBoundsListener(ItemBoundsListener ibl) Remove an ItemBoundsListener to receive notifications when the bounds
occupied by the VisualItems in this Display change. | public void | removePaintListener(PaintListener pl) Remove a PaintListener from this Display. | public void | renderImmediate(VisualItem item) Immediately render the given VisualItem to the screen. | public void | repaintImmediate() Immediately repaints the contents of the offscreen buffer
to the screen. | public void | reset() Resets the display by clearing the offscreen buffer and flushing the
internal rendering queue. | public synchronized void | rotate(Point2D p, double theta) Rotates the view provided by this display by the given angle in radians,
anchoring the rotation at the specified point in screen coordinates. | public synchronized void | rotateAbs(Point2D p, double theta) Rotates the view provided by this display by the given angle in radians,
anchoring the rotation at the specified point in absolute coordinates.
Parameters: p - the anchor point for the rotation, in absolute(i.e. | public boolean | saveImage(OutputStream output, String format, double scale) Saves a copy of this display as an image to the specified output stream.
Parameters: output - the output stream to write to. Parameters: format - the image format (e.g., "JPG", "PNG"). | public synchronized void | setBackgroundImage(Image image, boolean fixed, boolean tileImage) Set a background image for this display.
Parameters: image - the background Image. | public synchronized void | setBackgroundImage(String location, boolean fixed, boolean tileImage) Set a background image for this display.
Parameters: location - a location String of where to retrieve theimage file from. | public void | setBounds(int x, int y, int w, int h) | public void | setCustomToolTip(JToolTip tooltip) Set a custom tooltip to use for this Display. | public synchronized void | setDamageRedraw(boolean b) Sets if damage/redraw rendering is enabled. | public void | setFont(Font f) Sets the font used by this Display. | public void | setHighQuality(boolean on) Determines if the Display uses a higher quality rendering, using
anti-aliasing. | public synchronized void | setItemSorter(ItemSorter cmp) Set the ItemSorter that determines the rendering order of the
VisualItems. | public void | setPredicate(String expr) Sets the filtering Predicate used to control what items are drawn by
this Display.
Parameters: expr - the filtering predicate to use. | public synchronized void | setPredicate(Predicate p) Sets the filtering Predicate used to control what items are drawn by
this Display. | protected void | setRenderingHints(Graphics2D g) Sets the rendering hints that should be used while drawing
the visualization to the screen. | public void | setSize(int width, int height) Set the size of the Display. | public void | setSize(Dimension d) Set the size of the Display. | public void | setTextEditor(JTextComponent tc) Sets the TextComponent used for on-screen text editing. | public synchronized void | setTransform(AffineTransform transform) Set the 2D AffineTransform (e.g., scale, shear, pan, rotate) used by
this display before rendering visual items. | public void | setVisualization(Visualization vis) Set the Visualiztion associated with this Display. | public void | stopEditing() Stops text editing on the display, hiding the text editing widget. | public void | update(Graphics g) | public synchronized void | zoom(Point2D p, double scale) Zooms the view provided by this display by the given scale,
anchoring the zoom at the specified point in screen coordinates. | public synchronized void | zoomAbs(Point2D p, double scale) Zooms the view provided by this display by the given scale,
anchoring the zoom at the specified point in absolute coordinates.
Parameters: p - the anchor point for the zoom, in absolute(i.e. |
frameRate | protected double frameRate(Code) | | |
m_damageRedraw | protected boolean m_damageRedraw(Code) | | |
m_highQuality | protected boolean m_highQuality(Code) | | |
m_transact | protected TransformActivity m_transact(Code) | | |
m_visibleCount | protected int m_visibleCount(Code) | | |
nframes | protected int nframes(Code) | | |
Display | public Display()(Code) | | Creates a new Display instance. You will need to associate this
Display with a
Visualization for it to display anything.
|
Display | public Display(Visualization visualization, String predicate)(Code) | | Creates a new Display associated with the given Visualization that
draws all VisualItems in the visualization that pass the given
Predicate. The predicate string will be parsed by the
prefuse.data.expression.parser.ExpressionParser to get a
prefuse.data.expression.Predicate instance.
Parameters: visualization - the Visualization backing this Display Parameters: predicate - a predicate expression in the prefuse expressionlanguage. This expression will be parsed; if the parsing fails or doesnot result in a Predicate instance, an exception will result. |
addControlListener | public void addControlListener(Control cl)(Code) | | Adds a ControlListener to receive all input events on VisualItems.
Parameters: cl - the listener to add. |
animatePan | public synchronized void animatePan(double dx, double dy, long duration)(Code) | | Animate a pan along the specified distance in screen (pixel)
co-ordinates using the provided duration.
Parameters: dx - the amount to pan along the x-dimension, in pixel units Parameters: dy - the amount to pan along the y-dimension, in pixel units Parameters: duration - the duration of the animation, in milliseconds |
animatePanAbs | public synchronized void animatePanAbs(double dx, double dy, long duration)(Code) | | Animate a pan along the specified distance in absolute (item-space)
co-ordinates using the provided duration.
Parameters: dx - the amount to pan along the x-dimension, in absolute co-ords Parameters: dy - the amount to pan along the y-dimension, in absolute co-ords Parameters: duration - the duration of the animation, in milliseconds |
animatePanAndZoomTo | public synchronized void animatePanAndZoomTo(Point2D p, double scale, long duration)(Code) | | Animate a pan to the specified location in screen (pixel)
co-ordinates and zoom to the given scale using the provided duration.
Parameters: p - the point to center on in screen (pixel) units Parameters: scale - the scale factor to zoom by Parameters: duration - the duration of the animation, in milliseconds |
animatePanAndZoomToAbs | public synchronized void animatePanAndZoomToAbs(Point2D p, double scale, long duration)(Code) | | Animate a pan to the specified location in absolute (item-space)
co-ordinates and zoom to the given scale using the provided duration.
Parameters: p - the point to center on in absolute (item-space) units Parameters: scale - the scale factor to zoom by Parameters: duration - the duration of the animation, in milliseconds |
animatePanTo | public synchronized void animatePanTo(Point2D p, long duration)(Code) | | Animate a pan to the specified location in screen (pixel)
co-ordinates using the provided duration.
Parameters: p - the point to pan to in screen (pixel) units Parameters: duration - the duration of the animation, in milliseconds |
animatePanToAbs | public synchronized void animatePanToAbs(Point2D p, long duration)(Code) | | Animate a pan to the specified location in absolute (item-space)
co-ordinates using the provided duration.
Parameters: p - the point to pan to in absolute (item-space) units Parameters: duration - the duration of the animation, in milliseconds |
animateZoom | public synchronized void animateZoom(Point2D p, double scale, long duration)(Code) | | Animate a zoom centered on a given location in screen (pixel)
co-ordinates by the given scale using the provided duration.
Parameters: p - the point to center on in screen (pixel) units Parameters: scale - the scale factor to zoom by Parameters: duration - the duration of the animation, in milliseconds |
animateZoomAbs | public synchronized void animateZoomAbs(Point2D p, double scale, long duration)(Code) | | Animate a zoom centered on a given location in absolute (item-space)
co-ordinates by the given scale using the provided duration.
Parameters: p - the point to center on in absolute (item-space) units Parameters: scale - the scale factor to zoom by Parameters: duration - the duration of the animation, in milliseconds |
checkItemBoundsChanged | protected void checkItemBoundsChanged(Rectangle2D prev)(Code) | | Check if the item bounds has changed, and if so, fire a notification.
Parameters: prev - the previous item bounds of the Display |
clearDamage | public synchronized void clearDamage()(Code) | | Clears any reports of damaged regions, causing the Display to believe
that the display contents are up-to-date. If used incorrectly this
can cause inaccurate rendering. Call this method only
if you know what you are doing.
|
clearRegion | protected void clearRegion(Graphics2D g, Rectangle2D r)(Code) | | Clears the specified region of the display
in the display's offscreen buffer.
|
damageReport | public synchronized void damageReport(Rectangle2D region)(Code) | | Reports damage to the Display within in the specified region.
Parameters: region - the damaged region, in absolute coordinates |
damageReport | public synchronized void damageReport()(Code) | | Reports damage to the entire Display.
|
editText | public void editText(VisualItem item, String attribute)(Code) | | Edit text for the given VisualItem and attribute. Presents a text
editing widget spaning the item's bounding box. Use stopEditing()
to hide the text widget. When stopEditing() is called, the data field
will automatically be updated with the VisualItem.
Parameters: item - the VisualItem to edit Parameters: attribute - the attribute to edit |
editText | public void editText(VisualItem item, String attribute, Rectangle r)(Code) | | Edit text for the given VisualItem and field. Presents a text
editing widget spaning the given bounding box. Use stopEditing()
to hide the text widget. When stopEditing() is called, the field
will automatically be updated with the VisualItem.
Parameters: item - the VisualItem to edit Parameters: attribute - the attribute to edit Parameters: r - Rectangle representing the desired bounding box of the textediting widget |
editText | public void editText(String txt, Rectangle r)(Code) | | Show a text editing widget containing the given text and spanning the
specified bounding box. Use stopEditing() to hide the text widget. Use
the method calls getTextEditor().getText() to get the resulting edited
text.
Parameters: txt - the text string to display in the text widget Parameters: r - Rectangle representing the desired bounding box of the textediting widget |
findItem | public synchronized VisualItem findItem(Point p)(Code) | | Returns the VisualItem located at the given point.
Parameters: p - the Point at which to look the VisualItem located at the given point, if any |
firePostPaint | protected void firePostPaint(Graphics2D g)(Code) | | Fires a post-paint notification to PaintListeners.
Parameters: g - the current graphics context |
firePrePaint | protected void firePrePaint(Graphics2D g)(Code) | | Fires a pre-paint notification to PaintListeners.
Parameters: g - the current graphics context |
getAbsoluteCoordinate | public Point2D getAbsoluteCoordinate(Point2D screen, Point2D abs)(Code) | | Gets the absolute co-ordinate corresponding to the given screen
co-ordinate.
Parameters: screen - the screen co-ordinate to transform Parameters: abs - a reference to put the result in. If this is the sameobject as the screen co-ordinate, it will be overridden safely. Ifthis value is null, a new Point2D instance will be created and returned. the point in absolute co-ordinates |
getCustomToolTip | public JToolTip getCustomToolTip()(Code) | | Get the custom tooltip used by this Display. Returns null if normal
tooltips are being used.
the custom tooltip used by this Display, or null if none |
getDisplayX | public double getDisplayX()(Code) | | Returns the x-coordinate of the top-left of the display,
in absolute (item-space) co-ordinates.
the x co-ord of the top-left corner, in absolute coordinates |
getDisplayY | public double getDisplayY()(Code) | | Returns the y-coordinate of the top-left of the display,
in absolute (item-space) co-ordinates.
the y co-ord of the top-left corner, in absolute coordinates |
getFrameRate | public double getFrameRate()(Code) | | Returns the running average frame rate for this Display.
the frame rate |
getInverseTransform | public AffineTransform getInverseTransform()(Code) | | Returns a reference to the inverse of the AffineTransformation used by
this display. Direct changes made to this reference WILL corrupt the
state of this display.
the inverse AffineTransform |
getItemBounds | public synchronized Rectangle2D getItemBounds()(Code) | | Returns the bounds, in absolute (item-space) coordinates, of the total
bounds occupied by all currently visible VisualItems. This method
allocates a new Rectangle2D instance for the result.
the bounding box of all visibile VisualItems See Also: Display.getItemBounds(Rectangle2D) |
getItemBounds | public synchronized Rectangle2D getItemBounds(Rectangle2D b)(Code) | | Returns the bounds, in absolute (item-space) coordinates, of the total
bounds occupied by all currently visible VisualItems.
Parameters: b - the Rectangle2D to use to store the return value the bounding box of all visibile VisualItems |
getItemSorter | public ItemSorter getItemSorter()(Code) | | Get the ItemSorter that determines the rendering order of the
VisualItems. Items are drawn in ascending order of the scores provided
by the ItemSorter.
this Display's prefuse.visual.sort.ItemSorter |
getNewOffscreenBuffer | protected BufferedImage getNewOffscreenBuffer(int width, int height)(Code) | | Creates a new buffered image to use as an offscreen buffer.
|
getOffscreenBuffer | public BufferedImage getOffscreenBuffer()(Code) | | Returns the offscreen buffer used for double buffering.
the offscreen buffer |
getScale | public double getScale()(Code) | | Returns the current scale (zoom) value.
the current scale. This is thescaling factor along the x-dimension, so be careful whenusing this value in rare non-uniform scaling cases. |
getTextEditor | public JTextComponent getTextEditor()(Code) | | Returns the TextComponent used for on-screen text editing.
the TextComponent used for text editing |
getTransform | public AffineTransform getTransform()(Code) | | Returns a reference to the AffineTransformation used by this Display.
Changes made to this reference WILL corrupt the state of
this display. Use setTransform() to safely update the transform state.
the AffineTransform |
getVisibleItemCount | public int getVisibleItemCount()(Code) | | Returns the number of visible items processed by this Display. This
includes items not currently visible on screen due to the current
panning or zooming state.
the count of visible items |
isDamageRedraw | public synchronized boolean isDamageRedraw()(Code) | | Indicates if damage/redraw rendering is enabled. If enabled, the display
will only redraw within the bounding box of all areas that have changed
since the last rendering operation. For small changes, such as a single
item being dragged, this can result in a significant performance
increase. By default, the damage/redraw optimization is enabled. It can
be disabled, however, if rendering artifacts are appearing in your
visualization. Be careful though, as this may not be the best solution.
Rendering artifacts may result because the item bounds returned by
prefuse.visual.VisualItem.getBounds are not accurate and the
item's
prefuse.render.Renderer is drawing outside of the
reported bounds. In this case, there is usually a bug in the Renderer.
One reported problem arises from Java itself, however, which
inaccurately redraws images outside of their reported bounds. If you
have a visulization with a number of images and are seeing rendering
artifacts, try disabling damage/redraw.
true if damage/redraw optimizations are enabled, falseotherwise (in which case the entire Display is redrawn upon a repaint) |
isHighQuality | public boolean isHighQuality()(Code) | | Indicates if the Display is using high quality (return value true) or
regular quality (return value false) rendering.
true if high quality rendering is enabled, false otherwise |
isTranformInProgress | public boolean isTranformInProgress()(Code) | | Indicates if a view transformation is currently underway.
true if a transform is in progress, false otherwise |
paintBufferToScreen | protected void paintBufferToScreen(Graphics g)(Code) | | Paints the offscreen buffer to the provided graphics context.
Parameters: g - the Graphics context to paint to |
paintDisplay | public void paintDisplay(Graphics2D g2D, Dimension d)(Code) | | Renders the display within the given graphics context and size bounds.
Parameters: g2D - the Graphics2D context to use for rendering Parameters: d - the rendering width and height of the Display |
pan | public synchronized void pan(double dx, double dy)(Code) | | Pans the view provided by this display in screen coordinates.
Parameters: dx - the amount to pan along the x-dimension, in pixel units Parameters: dy - the amount to pan along the y-dimension, in pixel units |
panAbs | public synchronized void panAbs(double dx, double dy)(Code) | | Pans the view provided by this display in absolute (i.e. item-space)
coordinates.
Parameters: dx - the amount to pan along the x-dimension, in absolute co-ords Parameters: dy - the amount to pan along the y-dimension, in absolute co-ords |
panTo | public synchronized void panTo(Point2D p)(Code) | | Pans the display view to center on the provided point in
screen (pixel) coordinates.
Parameters: p - the point to center on, in screen co-ords |
panToAbs | public synchronized void panToAbs(Point2D p)(Code) | | Pans the display view to center on the provided point in
absolute (i.e. item-space) coordinates.
Parameters: p - the point to center on, in absolute co-ords |
prepareGraphics | protected void prepareGraphics(Graphics2D g)(Code) | | Sets the transform of the provided Graphics context to be the
transform of this Display and sets the desired rendering hints.
Parameters: g - the Graphics context to prepare. |
printComponent | protected void printComponent(Graphics g)(Code) | | Paints the graph to the provided graphics context, for output to a
printer. This method does not double buffer the painting, in order to
provide the maximum print quality.
This method may not be working correctly,
and will be repaired at a later date.
Parameters: g - the printer graphics context. |
registerDefaultCommands | protected void registerDefaultCommands()(Code) | | Registers default keystroke commands on the Display. The default
commands are
- ctrl D - Toggle debug info display
- ctrl H - Toggle high quality rendering
- ctrl E - Export display view to an image file
Subclasses can override this method to prevent these commands from
being set. Additional commands can be registered using the
registerKeyboardAction method.
|
removeControlListener | public void removeControlListener(Control cl)(Code) | | Removes a registered ControlListener.
Parameters: cl - the listener to remove. |
renderImmediate | public void renderImmediate(VisualItem item)(Code) | | Immediately render the given VisualItem to the screen. This method
bypasses the Display's offscreen buffer.
Parameters: item - the VisualItem to render immediately |
repaintImmediate | public void repaintImmediate()(Code) | | Immediately repaints the contents of the offscreen buffer
to the screen. This bypasses the usual rendering loop.
|
reset | public void reset()(Code) | | Resets the display by clearing the offscreen buffer and flushing the
internal rendering queue. This method can help reclaim memory when a
Display is not visible.
|
rotate | public synchronized void rotate(Point2D p, double theta)(Code) | | Rotates the view provided by this display by the given angle in radians,
anchoring the rotation at the specified point in screen coordinates.
Parameters: p - the anchor point for the rotation, in screen coordinates Parameters: theta - the angle to rotate by, in radians |
rotateAbs | public synchronized void rotateAbs(Point2D p, double theta)(Code) | | Rotates the view provided by this display by the given angle in radians,
anchoring the rotation at the specified point in absolute coordinates.
Parameters: p - the anchor point for the rotation, in absolute(i.e. item-space) co-ordinates Parameters: theta - the angle to rotation by, in radians |
saveImage | public boolean saveImage(OutputStream output, String format, double scale)(Code) | | Saves a copy of this display as an image to the specified output stream.
Parameters: output - the output stream to write to. Parameters: format - the image format (e.g., "JPG", "PNG"). The number and kindof available formats varies by platform. Seejavax.imageio.ImageIO and related classes for more. Parameters: scale - how much to scale the image by. For example, a value of 2.0will result in an image with twice the pixel width and height of thisDisplay. true if image was successfully saved, false if an error occurred. |
setBackgroundImage | public synchronized void setBackgroundImage(Image image, boolean fixed, boolean tileImage)(Code) | | Set a background image for this display.
Parameters: image - the background Image. If a null value is provided, than no background image will be shown. Parameters: fixed - true if the background image should stay in a fixedposition, invariant to panning, zooming, or rotation; false ifthe image should be subject to view transforms Parameters: tileImage - true to tile the image across the visible background,false to only include the image once |
setBackgroundImage | public synchronized void setBackgroundImage(String location, boolean fixed, boolean tileImage)(Code) | | Set a background image for this display.
Parameters: location - a location String of where to retrieve theimage file from. Usesprefuse.util.io.IOLib.urlFromString(String) to resolvethe String. If a null value is provided, than no backgroundimage will be shown. Parameters: fixed - true if the background image should stay in a fixedposition, invariant to panning, zooming, or rotation; false ifthe image should be subject to view transforms Parameters: tileImage - true to tile the image across the visible background,false to only include the image once |
setCustomToolTip | public void setCustomToolTip(JToolTip tooltip)(Code) | | Set a custom tooltip to use for this Display. To trigger tooltip
display, you must still use the setToolTipText method
as usual. The actual text will no longer have any effect, other
than that a null text value will result in no tooltip display
while a non-null text value will result in a tooltip being
shown. Clients are responsible for setting the tool tip
text to enable/disable tooltips as well as updating the content
of their own custom tooltip instance.
Parameters: tooltip - the tooltip component to use See Also: prefuse.util.ui.JCustomTooltip |
setDamageRedraw | public synchronized void setDamageRedraw(boolean b)(Code) | | Sets if damage/redraw rendering is enabled. If enabled, the display
will only redraw within the bounding box of all areas that have changed
since the last rendering operation. For small changes, such as a single
item being dragged, this can result in a significant performance
increase. By default, the damage/redraw optimization is enabled. It can
be disabled, however, if rendering artifacts are appearing in your
visualization. Be careful though, as this may not be the best solution.
Rendering artifacts may result because the item bounds returned by
prefuse.visual.VisualItem.getBounds are not accurate and the
item's
prefuse.render.Renderer is drawing outside of the
reported bounds. In this case, there is usually a bug in the Renderer.
One reported problem arises from Java itself, however, which
inaccurately redraws images outside of their reported bounds. If you
have a visulization with a number of images and are seeing rendering
artifacts, try disabling damage/redraw.
Parameters: b - true to enable damage/redraw optimizations, false otherwise(in which case the entire Display will be redrawn upon a repaint) |
setFont | public void setFont(Font f)(Code) | | Sets the font used by this Display. This determines the font used
by this Display's text editor and in any debugging text.
Parameters: f - the Font to use |
setHighQuality | public void setHighQuality(boolean on)(Code) | | Determines if the Display uses a higher quality rendering, using
anti-aliasing. This causes drawing to be much slower, however, and
so is disabled by default.
Parameters: on - true to enable anti-aliased rendering, false to disable it |
setItemSorter | public synchronized void setItemSorter(ItemSorter cmp)(Code) | | Set the ItemSorter that determines the rendering order of the
VisualItems. Items are drawn in ascending order of the scores provided
by the ItemSorter.
the prefuse.visual.sort.ItemSorter to use |
setRenderingHints | protected void setRenderingHints(Graphics2D g)(Code) | | Sets the rendering hints that should be used while drawing
the visualization to the screen. Subclasses can override
this method to set hints as desired. Such subclasses should
consider honoring the high quality flag in one form or another.
Parameters: g - the Graphics context on which to set the rendering hints |
setSize | public void setSize(int width, int height)(Code) | | Set the size of the Display.
Parameters: width - the width of the Display in pixels Parameters: height - the height of the Display in pixels See Also: java.awt.Component.setSize(intint) |
setTextEditor | public void setTextEditor(JTextComponent tc)(Code) | | Sets the TextComponent used for on-screen text editing.
Parameters: tc - the TextComponent to use for text editing |
setTransform | public synchronized void setTransform(AffineTransform transform) throws NoninvertibleTransformException(Code) | | Set the 2D AffineTransform (e.g., scale, shear, pan, rotate) used by
this display before rendering visual items. The provided transform
must be invertible, otherwise an expection will be thrown. For simple
panning and zooming transforms, you can instead use the provided
pan() and zoom() methods.
|
setVisualization | public void setVisualization(Visualization vis)(Code) | | Set the Visualiztion associated with this Display. This Display
will render the items contained in the provided visualization. If this
Display is already associated with a different Visualization, the
Display unregisters itself with the previous one.
Parameters: vis - the backing Visualization to use. |
stopEditing | public void stopEditing()(Code) | | Stops text editing on the display, hiding the text editing widget. If
the text editor was associated with a specific VisualItem (ie one of the
editText() methods which include a VisualItem as an argument was called),
the item is updated with the edited text.
|
zoom | public synchronized void zoom(Point2D p, double scale)(Code) | | Zooms the view provided by this display by the given scale,
anchoring the zoom at the specified point in screen coordinates.
Parameters: p - the anchor point for the zoom, in screen coordinates Parameters: scale - the amount to zoom by |
zoomAbs | public synchronized void zoomAbs(Point2D p, double scale)(Code) | | Zooms the view provided by this display by the given scale,
anchoring the zoom at the specified point in absolute coordinates.
Parameters: p - the anchor point for the zoom, in absolute(i.e. item-space) co-ordinates Parameters: scale - the amount to zoom by |
Methods inherited from javax.swing.JComponent | public void addAncestorListener(AncestorListener listener)(Code)(Java Doc) public void addNotify()(Code)(Java Doc) public synchronized void addVetoableChangeListener(VetoableChangeListener listener)(Code)(Java Doc) public void computeVisibleRect(Rectangle visibleRect)(Code)(Java Doc) public boolean contains(int x, int y)(Code)(Java Doc) public JToolTip createToolTip()(Code)(Java Doc) public void disable()(Code)(Java Doc) public void enable()(Code)(Java Doc) public void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)(Code)(Java Doc) public void firePropertyChange(String propertyName, int oldValue, int newValue)(Code)(Java Doc) public void firePropertyChange(String propertyName, char oldValue, char newValue)(Code)(Java Doc) protected void fireVetoableChange(String propertyName, Object oldValue, Object newValue) throws java.beans.PropertyVetoException(Code)(Java Doc) public AccessibleContext getAccessibleContext()(Code)(Java Doc) public ActionListener getActionForKeyStroke(KeyStroke aKeyStroke)(Code)(Java Doc) final public ActionMap getActionMap()(Code)(Java Doc) public float getAlignmentX()(Code)(Java Doc) public float getAlignmentY()(Code)(Java Doc) public AncestorListener[] getAncestorListeners()(Code)(Java Doc) public boolean getAutoscrolls()(Code)(Java Doc) public int getBaseline(int width, int height)(Code)(Java Doc) public BaselineResizeBehavior getBaselineResizeBehavior()(Code)(Java Doc) public Border getBorder()(Code)(Java Doc) public Rectangle getBounds(Rectangle rv)(Code)(Java Doc) final public Object getClientProperty(Object key)(Code)(Java Doc) protected Graphics getComponentGraphics(Graphics g)(Code)(Java Doc) public JPopupMenu getComponentPopupMenu()(Code)(Java Doc) public int getConditionForKeyStroke(KeyStroke aKeyStroke)(Code)(Java Doc) public int getDebugGraphicsOptions()(Code)(Java Doc) public static Locale getDefaultLocale()(Code)(Java Doc) public FontMetrics getFontMetrics(Font font)(Code)(Java Doc) public Graphics getGraphics()(Code)(Java Doc) public int getHeight()(Code)(Java Doc) public boolean getInheritsPopupMenu()(Code)(Java Doc) final public InputMap getInputMap(int condition)(Code)(Java Doc) final public InputMap getInputMap()(Code)(Java Doc) public InputVerifier getInputVerifier()(Code)(Java Doc) public Insets getInsets()(Code)(Java Doc) public Insets getInsets(Insets insets)(Code)(Java Doc) public T[] getListeners(Class<T> listenerType)(Code)(Java Doc) public Point getLocation(Point rv)(Code)(Java Doc) public Dimension getMaximumSize()(Code)(Java Doc) public Dimension getMinimumSize()(Code)(Java Doc) public Component getNextFocusableComponent()(Code)(Java Doc) public Point getPopupLocation(MouseEvent event)(Code)(Java Doc) public Dimension getPreferredSize()(Code)(Java Doc) public KeyStroke[] getRegisteredKeyStrokes()(Code)(Java Doc) public JRootPane getRootPane()(Code)(Java Doc) public Dimension getSize(Dimension rv)(Code)(Java Doc) public Point getToolTipLocation(MouseEvent event)(Code)(Java Doc) public String getToolTipText()(Code)(Java Doc) public String getToolTipText(MouseEvent event)(Code)(Java Doc) public Container getTopLevelAncestor()(Code)(Java Doc) public TransferHandler getTransferHandler()(Code)(Java Doc) public String getUIClassID()(Code)(Java Doc) public boolean getVerifyInputWhenFocusTarget()(Code)(Java Doc) public synchronized VetoableChangeListener[] getVetoableChangeListeners()(Code)(Java Doc) public Rectangle getVisibleRect()(Code)(Java Doc) public int getWidth()(Code)(Java Doc) public int getX()(Code)(Java Doc) public int getY()(Code)(Java Doc) public void grabFocus()(Code)(Java Doc) public boolean isDoubleBuffered()(Code)(Java Doc) public static boolean isLightweightComponent(Component c)(Code)(Java Doc) public boolean isManagingFocus()(Code)(Java Doc) public boolean isOpaque()(Code)(Java Doc) public boolean isOptimizedDrawingEnabled()(Code)(Java Doc) final public boolean isPaintingForPrint()(Code)(Java Doc) public boolean isPaintingTile()(Code)(Java Doc) public boolean isRequestFocusEnabled()(Code)(Java Doc) public boolean isValidateRoot()(Code)(Java Doc) public void paint(Graphics g)(Code)(Java Doc) protected void paintBorder(Graphics g)(Code)(Java Doc) protected void paintChildren(Graphics g)(Code)(Java Doc) protected void paintComponent(Graphics g)(Code)(Java Doc) public void paintImmediately(int x, int y, int w, int h)(Code)(Java Doc) public void paintImmediately(Rectangle r)(Code)(Java Doc) protected String paramString()(Code)(Java Doc) public void print(Graphics g)(Code)(Java Doc) public void printAll(Graphics g)(Code)(Java Doc) protected void printBorder(Graphics g)(Code)(Java Doc) protected void printChildren(Graphics g)(Code)(Java Doc) protected void printComponent(Graphics g)(Code)(Java Doc) protected void processComponentKeyEvent(KeyEvent e)(Code)(Java Doc) protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed)(Code)(Java Doc) protected void processKeyEvent(KeyEvent e)(Code)(Java Doc) protected void processMouseEvent(MouseEvent e)(Code)(Java Doc) protected void processMouseMotionEvent(MouseEvent e)(Code)(Java Doc) final public void putClientProperty(Object key, Object value)(Code)(Java Doc) public void registerKeyboardAction(ActionListener anAction, String aCommand, KeyStroke aKeyStroke, int aCondition)(Code)(Java Doc) public void registerKeyboardAction(ActionListener anAction, KeyStroke aKeyStroke, int aCondition)(Code)(Java Doc) public void removeAncestorListener(AncestorListener listener)(Code)(Java Doc) public void removeNotify()(Code)(Java Doc) public synchronized void removeVetoableChangeListener(VetoableChangeListener listener)(Code)(Java Doc) public void repaint(long tm, int x, int y, int width, int height)(Code)(Java Doc) public void repaint(Rectangle r)(Code)(Java Doc) public boolean requestDefaultFocus()(Code)(Java Doc) public void requestFocus()(Code)(Java Doc) public boolean requestFocus(boolean temporary)(Code)(Java Doc) public boolean requestFocusInWindow()(Code)(Java Doc) protected boolean requestFocusInWindow(boolean temporary)(Code)(Java Doc) public void resetKeyboardActions()(Code)(Java Doc) public void reshape(int x, int y, int w, int h)(Code)(Java Doc) public void revalidate()(Code)(Java Doc) public void scrollRectToVisible(Rectangle aRect)(Code)(Java Doc) final public void setActionMap(ActionMap am)(Code)(Java Doc) public void setAlignmentX(float alignmentX)(Code)(Java Doc) public void setAlignmentY(float alignmentY)(Code)(Java Doc) public void setAutoscrolls(boolean autoscrolls)(Code)(Java Doc) public void setBackground(Color bg)(Code)(Java Doc) public void setBorder(Border border)(Code)(Java Doc) public void setComponentPopupMenu(JPopupMenu popup)(Code)(Java Doc) public void setDebugGraphicsOptions(int debugOptions)(Code)(Java Doc) public static void setDefaultLocale(Locale l)(Code)(Java Doc) public void setDoubleBuffered(boolean aFlag)(Code)(Java Doc) public void setEnabled(boolean enabled)(Code)(Java Doc) public void setFocusTraversalKeys(int id, Set<? extends AWTKeyStroke> keystrokes)(Code)(Java Doc) public void setFont(Font font)(Code)(Java Doc) public void setForeground(Color fg)(Code)(Java Doc) public void setInheritsPopupMenu(boolean value)(Code)(Java Doc) final public void setInputMap(int condition, InputMap map)(Code)(Java Doc) public void setInputVerifier(InputVerifier inputVerifier)(Code)(Java Doc) public void setMaximumSize(Dimension maximumSize)(Code)(Java Doc) public void setMinimumSize(Dimension minimumSize)(Code)(Java Doc) public void setNextFocusableComponent(Component aComponent)(Code)(Java Doc) public void setOpaque(boolean isOpaque)(Code)(Java Doc) public void setPreferredSize(Dimension preferredSize)(Code)(Java Doc) public void setRequestFocusEnabled(boolean requestFocusEnabled)(Code)(Java Doc) public void setToolTipText(String text)(Code)(Java Doc) public void setTransferHandler(TransferHandler newHandler)(Code)(Java Doc) protected void setUI(ComponentUI newUI)(Code)(Java Doc) public void setVerifyInputWhenFocusTarget(boolean verifyInputWhenFocusTarget)(Code)(Java Doc) public void setVisible(boolean aFlag)(Code)(Java Doc) public void unregisterKeyboardAction(KeyStroke aKeyStroke)(Code)(Java Doc) public void update(Graphics g)(Code)(Java Doc) public void updateUI()(Code)(Java Doc)
|
|
|