Search this API

y.view
Class YRenderingHints

java.lang.Object
  extended by y.view.YRenderingHints

public class YRenderingHints
extends java.lang.Object

Provides rendering hint keys whose associated values may be interpreted by NodeRealizer, EdgeRealizer and other objects that are drawn within a Graph2DView.

 

Nested Class Summary
static interface YRenderingHints.AntiAliasingHandler
          Specifies the contract for KEY_ANTIALIASING_HANDLER hint values.
 
Field Summary
static java.awt.RenderingHints.Key GRAPHICS_CONTEXT_KEY
          A key whose associated value must be of type GraphicsContext.
static java.awt.RenderingHints.Key KEY_ANTIALIASING_HANDLER
          Anti-aliasing handler hint key.
static java.awt.RenderingHints.Key KEY_EDGE_LABEL_PAINTING
          Edge label painting hint key.
static java.awt.RenderingHints.Key KEY_GRADIENT_PAINTING
          Gradient painting hint key.
static java.awt.RenderingHints.Key KEY_GROUP_STATE_PAINTING
          Group state painting hint key.
static java.awt.RenderingHints.Key KEY_NODE_LABEL_PAINTING
          Node label painting hint key.
static java.awt.RenderingHints.Key KEY_NODE_PORT_PAINTING
          Node port painting hint key.
static java.awt.RenderingHints.Key KEY_SELECTION_PAINTING
          Selection painting hint key.
static java.awt.RenderingHints.Key KEY_SHADOW_PAINTING
          Shadow painting hint key.
static java.awt.RenderingHints.Key KEY_SLOPPY_POLYLINE_PAINTING
          Sloppy polyline hint key.
static java.awt.RenderingHints.Key PAINT_DETAIL_THRESHOLD_KEY
          A key whose associated value must be of type Double.
static java.lang.Object VALUE_ANTIALIASING_HANDLER_DESKTOP
          Anti-aliasing handler hint value --- sets the standard anti-aliasing hint and the awt.font.desktophints of the given graphics context's associated GraphicsDevice instance.
static java.lang.Object VALUE_EDGE_LABEL_PAINTING_DEFAULT
          Edge label painting hint value --- rendering takes labels into account depending on rendering mode.
static java.lang.Object VALUE_EDGE_LABEL_PAINTING_OFF
          Edge label painting hint value --- rendering ignores labels.
static java.lang.Object VALUE_EDGE_LABEL_PAINTING_ON
          Edge label painting hint value --- rendering takes labels into account.
static java.lang.Object VALUE_GRADIENT_PAINTING_OFF
          Gradient painting hint value --- rendering uses a single color instead of gradient paints.
static java.lang.Object VALUE_GROUP_STATE_PAINTING_DEFAULT
          Group state painting hint value --- a state icon is rendered depending on rendering mode.
static java.lang.Object VALUE_GROUP_STATE_PAINTING_OFF
          Group state painting hint value --- no state icon is rendered.
static java.lang.Object VALUE_GROUP_STATE_PAINTING_ON
          Group state painting hint value --- a state icon is rendered.
static java.lang.Object VALUE_NODE_LABEL_PAINTING_DEFAULT
          Node label painting hint value --- rendering takes labels into account depending on rendering mode.
static java.lang.Object VALUE_NODE_LABEL_PAINTING_OFF
          Node label painting hint value --- rendering ignores labels.
static java.lang.Object VALUE_NODE_LABEL_PAINTING_ON
          Node label painting hint value --- rendering takes labels into account.
static java.lang.Object VALUE_NODE_PORT_PAINTING_DEFAULT
          Node port painting hint value --- rendering takes ports into account depending on rendering mode.
static java.lang.Object VALUE_NODE_PORT_PAINTING_OFF
          Node port painting hint value --- rendering ignores ports.
static java.lang.Object VALUE_NODE_PORT_PAINTING_ON
          Node port painting hint value --- rendering takes ports into account.
static java.lang.Object VALUE_SELECTION_PAINTING_OFF
          Selection painting hint value --- rendering ignores the selection states of graph elements.
static java.lang.Object VALUE_SHADOW_PAINTING_OFF
          Shadow painting hint value --- no shadows are rendered..
static java.lang.Object VALUE_SLOPPY_POLYLINE_PAINTING_OFF
          Sloppy polyline painting hint value --- edges in sloppy mode will be rendered as in normal mode
 
Method Summary
static GraphicsContext getGraphicsContext(java.awt.Graphics2D g)
          Convenience method that tries to retrieve the GraphicsContext from the given graphics object.
static boolean isGradientPaintingEnabled(java.awt.Graphics2D g)
          Returns whether the rendering onto the specified graphics context should use gradient paints or single colors only.
static boolean isSelectionPaintingEnabled(java.awt.Graphics2D g)
          Returns whether or not rendering onto the specified graphics context should take the selection states of the graph elements being painted into account.
static boolean isShadowPaintingEnabled(java.awt.Graphics2D g)
          Returns whether or not shadows should be rendered onto the specified graphics.
static boolean isSloppyPolylinePaintingEnabled(java.awt.Graphics2D g)
          Returns whether or not sloppy mode renders edges as polylines onto the specified graphics context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_SELECTION_PAINTING

public static final java.awt.RenderingHints.Key KEY_SELECTION_PAINTING
Selection painting hint key. The SELECTION_PAINTING hint controls whether or not selection states are taken into account when rendering graph elements. The key's associated value must be either null or VALUE_SELECTION_PAINTING_OFF. If the associated value is VALUE_SELECTION_PAINTING_OFF, rendering ignores the selection states of graph elements.

See Also:
VALUE_SELECTION_PAINTING_OFF, isSelectionPaintingEnabled(java.awt.Graphics2D)

VALUE_SELECTION_PAINTING_OFF

public static final java.lang.Object VALUE_SELECTION_PAINTING_OFF
Selection painting hint value --- rendering ignores the selection states of graph elements.

See Also:
KEY_SELECTION_PAINTING, isSelectionPaintingEnabled(java.awt.Graphics2D)

KEY_EDGE_LABEL_PAINTING

public static final java.awt.RenderingHints.Key KEY_EDGE_LABEL_PAINTING
Edge label painting hint key. The EDGE_LABEL_PAINTING hint controls whether or not labels associated to an edge are rendered. The key's associated value must be one of

See Also:
VALUE_EDGE_LABEL_PAINTING_DEFAULT, VALUE_EDGE_LABEL_PAINTING_ON, VALUE_EDGE_LABEL_PAINTING_OFF

VALUE_EDGE_LABEL_PAINTING_DEFAULT

public static final java.lang.Object VALUE_EDGE_LABEL_PAINTING_DEFAULT
Edge label painting hint value --- rendering takes labels into account depending on rendering mode. That is, paint calls paintLabels but paintSloppy does not.

See Also:
KEY_EDGE_LABEL_PAINTING, EdgeRealizer.paint(java.awt.Graphics2D), EdgeRealizer.paintSloppy(java.awt.Graphics2D), EdgeRealizer.paintLabels(java.awt.Graphics2D)

VALUE_EDGE_LABEL_PAINTING_ON

public static final java.lang.Object VALUE_EDGE_LABEL_PAINTING_ON
Edge label painting hint value --- rendering takes labels into account. That is, both paint and paintSloppy call paintLabels.

See Also:
KEY_EDGE_LABEL_PAINTING, EdgeRealizer.paint(java.awt.Graphics2D), EdgeRealizer.paintSloppy(java.awt.Graphics2D), EdgeRealizer.paintLabels(java.awt.Graphics2D)

VALUE_EDGE_LABEL_PAINTING_OFF

public static final java.lang.Object VALUE_EDGE_LABEL_PAINTING_OFF
Edge label painting hint value --- rendering ignores labels. That is, neither paint nor paintSloppy calls paintLabels.

See Also:
KEY_EDGE_LABEL_PAINTING, EdgeRealizer.paint(java.awt.Graphics2D), EdgeRealizer.paintSloppy(java.awt.Graphics2D), EdgeRealizer.paintLabels(java.awt.Graphics2D)

KEY_NODE_LABEL_PAINTING

public static final java.awt.RenderingHints.Key KEY_NODE_LABEL_PAINTING
Node label painting hint key. The NODE_LABEL_PAINTING hint controls whether or not labels associated to a node are rendered. The key's associated value must be one of

See Also:
VALUE_NODE_LABEL_PAINTING_DEFAULT, VALUE_NODE_LABEL_PAINTING_ON, VALUE_NODE_LABEL_PAINTING_OFF

VALUE_NODE_LABEL_PAINTING_DEFAULT

public static final java.lang.Object VALUE_NODE_LABEL_PAINTING_DEFAULT
Node label painting hint value --- rendering takes labels into account depending on rendering mode. That is, paint calls paintText but paintSloppy does not.

See Also:
KEY_NODE_LABEL_PAINTING, NodeRealizer.paint(java.awt.Graphics2D), NodeRealizer.paintSloppy(java.awt.Graphics2D), NodeRealizer.paintText(java.awt.Graphics2D)

VALUE_NODE_LABEL_PAINTING_ON

public static final java.lang.Object VALUE_NODE_LABEL_PAINTING_ON
Node label painting hint value --- rendering takes labels into account. That is, both paint and paintSloppy call paintText.

See Also:
KEY_NODE_LABEL_PAINTING, NodeRealizer.paint(java.awt.Graphics2D), NodeRealizer.paintSloppy(java.awt.Graphics2D), NodeRealizer.paintText(java.awt.Graphics2D)

VALUE_NODE_LABEL_PAINTING_OFF

public static final java.lang.Object VALUE_NODE_LABEL_PAINTING_OFF
Node label painting hint value --- rendering ignores labels. That is, neither paint nor paintSloppy calls paintText.

See Also:
KEY_NODE_LABEL_PAINTING, NodeRealizer.paint(java.awt.Graphics2D), NodeRealizer.paintSloppy(java.awt.Graphics2D), NodeRealizer.paintText(java.awt.Graphics2D)

KEY_NODE_PORT_PAINTING

public static final java.awt.RenderingHints.Key KEY_NODE_PORT_PAINTING
Node port painting hint key. The NODE_PORT_PAINTING hint controls whether or not node ports associated to a node are rendered. The key's associated value must be one of

See Also:
VALUE_NODE_PORT_PAINTING_DEFAULT, VALUE_NODE_PORT_PAINTING_ON, VALUE_NODE_PORT_PAINTING_OFF

VALUE_NODE_PORT_PAINTING_DEFAULT

public static final java.lang.Object VALUE_NODE_PORT_PAINTING_DEFAULT
Node port painting hint value --- rendering takes ports into account depending on rendering mode. That is, paint calls paintPorts but paintSloppy does not.

See Also:
KEY_NODE_PORT_PAINTING, NodeRealizer.paint(java.awt.Graphics2D), NodeRealizer.paintSloppy(java.awt.Graphics2D), NodeRealizer.paintPorts(java.awt.Graphics2D)

VALUE_NODE_PORT_PAINTING_ON

public static final java.lang.Object VALUE_NODE_PORT_PAINTING_ON
Node port painting hint value --- rendering takes ports into account. That is, both paint and paintSloppy call paintPorts.

See Also:
KEY_NODE_PORT_PAINTING, NodeRealizer.paint(java.awt.Graphics2D), NodeRealizer.paintSloppy(java.awt.Graphics2D), NodeRealizer.paintPorts(java.awt.Graphics2D)

VALUE_NODE_PORT_PAINTING_OFF

public static final java.lang.Object VALUE_NODE_PORT_PAINTING_OFF
Node port painting hint value --- rendering ignores ports. That is, neither paint nor paintSloppy calls paintPorts.

See Also:
KEY_NODE_PORT_PAINTING, NodeRealizer.paint(java.awt.Graphics2D), NodeRealizer.paintSloppy(java.awt.Graphics2D), NodeRealizer.paintPorts(java.awt.Graphics2D)

KEY_GROUP_STATE_PAINTING

public static final java.awt.RenderingHints.Key KEY_GROUP_STATE_PAINTING
Group state painting hint key. The GROUP_STATE_PAINTING hint controls whether or not GroupNodeRealizer and GroupNodePainter will paint a state icon that symbolizes whether a group or a folder node is displayed. The key's associated value must be one of

See Also:
VALUE_GROUP_STATE_PAINTING_DEFAULT, VALUE_GROUP_STATE_PAINTING_ON, VALUE_GROUP_STATE_PAINTING_OFF

VALUE_GROUP_STATE_PAINTING_DEFAULT

public static final java.lang.Object VALUE_GROUP_STATE_PAINTING_DEFAULT
Group state painting hint value --- a state icon is rendered depending on rendering mode.

See Also:
KEY_GROUP_STATE_PAINTING, GroupNodeRealizer.paintGroupState(java.awt.Graphics2D, boolean), GroupNodePainter.paintGroupState(NodeRealizer, java.awt.Graphics2D, boolean)

VALUE_GROUP_STATE_PAINTING_ON

public static final java.lang.Object VALUE_GROUP_STATE_PAINTING_ON
Group state painting hint value --- a state icon is rendered.

See Also:
KEY_GROUP_STATE_PAINTING, GroupNodeRealizer.paintGroupState(java.awt.Graphics2D, boolean), GroupNodePainter.paintGroupState(NodeRealizer, java.awt.Graphics2D, boolean)

VALUE_GROUP_STATE_PAINTING_OFF

public static final java.lang.Object VALUE_GROUP_STATE_PAINTING_OFF
Group state painting hint value --- no state icon is rendered.

See Also:
KEY_GROUP_STATE_PAINTING, GroupNodeRealizer.paintGroupState(java.awt.Graphics2D, boolean), GroupNodePainter.paintGroupState(NodeRealizer, java.awt.Graphics2D, boolean)

KEY_GRADIENT_PAINTING

public static final java.awt.RenderingHints.Key KEY_GRADIENT_PAINTING
Gradient painting hint key. The GRADIENT_PAINTING hint controls whether or not rendering supports gradient paints. The key's associated value must be either null or VALUE_GRADIENT_PAINTING_OFF. If the associated value is VALUE_GRADIENT_PAINTING_OFF, rendering uses a single color instead of gradient paints.

See Also:
VALUE_GRADIENT_PAINTING_OFF, isGradientPaintingEnabled(java.awt.Graphics2D)

VALUE_GRADIENT_PAINTING_OFF

public static final java.lang.Object VALUE_GRADIENT_PAINTING_OFF
Gradient painting hint value --- rendering uses a single color instead of gradient paints.

See Also:
KEY_GRADIENT_PAINTING, isGradientPaintingEnabled(java.awt.Graphics2D)

KEY_SHADOW_PAINTING

public static final java.awt.RenderingHints.Key KEY_SHADOW_PAINTING
Shadow painting hint key. The SHADOW_PAINTING hint controls whether or not shadows are rendered. The key's associated value must be either null or VALUE_SHADOW_PAINTING_OFF. If the associated value is VALUE_SHADOW_PAINTING_OFF, no shadows are rendered.

See Also:
VALUE_SHADOW_PAINTING_OFF, isShadowPaintingEnabled(java.awt.Graphics2D)

VALUE_SHADOW_PAINTING_OFF

public static final java.lang.Object VALUE_SHADOW_PAINTING_OFF
Shadow painting hint value --- no shadows are rendered..

See Also:
KEY_SHADOW_PAINTING, isShadowPaintingEnabled(java.awt.Graphics2D)

KEY_SLOPPY_POLYLINE_PAINTING

public static final java.awt.RenderingHints.Key KEY_SLOPPY_POLYLINE_PAINTING
Sloppy polyline hint key. The SLOPPY_POLYLINE_PAINTING hint controls whether or not edges are rendered as polylines in sloppy mode. The key's associated value must be either null or VALUE_SLOPPY_POLYLINE_PAINTING_OFF. If the associated value is VALUE_SLOPPY_POLYLINE_PAINTING_OFF, edges will rendered as in normal mode.

See Also:
VALUE_SLOPPY_POLYLINE_PAINTING_OFF, isSloppyPolylinePaintingEnabled(java.awt.Graphics2D)

VALUE_SLOPPY_POLYLINE_PAINTING_OFF

public static final java.lang.Object VALUE_SLOPPY_POLYLINE_PAINTING_OFF
Sloppy polyline painting hint value --- edges in sloppy mode will be rendered as in normal mode

See Also:
KEY_SLOPPY_POLYLINE_PAINTING, isSloppyPolylinePaintingEnabled(java.awt.Graphics2D)

KEY_ANTIALIASING_HANDLER

public static final java.awt.RenderingHints.Key KEY_ANTIALIASING_HANDLER
Anti-aliasing handler hint key. The key's associated value must be either null or an instance of YRenderingHints.AntiAliasingHandler. If the associated value is an instance of AntiAliasingHandler, the instance's setRenderingHints method is called when painting the contents of a Graph2DView instance.

Client code should add this rendering hint to a Graph2DView's set of default rendering hints.

See Also:
VALUE_ANTIALIASING_HANDLER_DESKTOP, Graph2DView.setRenderingHints(java.awt.RenderingHints), Graph2DView.setRenderingHints(java.awt.Graphics2D)

VALUE_ANTIALIASING_HANDLER_DESKTOP

public static final java.lang.Object VALUE_ANTIALIASING_HANDLER_DESKTOP
Anti-aliasing handler hint value --- sets the standard anti-aliasing hint and the awt.font.desktophints of the given graphics context's associated GraphicsDevice instance. See AWT Desktop Properties for details.

Client code should add this rendering hint to a Graph2DView's set of default rendering hints.

See Also:
KEY_ANTIALIASING_HANDLER, Graph2DView.setRenderingHints(java.awt.RenderingHints)

PAINT_DETAIL_THRESHOLD_KEY

public static final java.awt.RenderingHints.Key PAINT_DETAIL_THRESHOLD_KEY
A key whose associated value must be of type Double. The value is interpreted as a threshold value of the graphics context scale value. If the actual scale value is smaller than the threshold then the client is requested to draw in an inexpensive less detailed mode. Otherwise the client is requested to draw in normal mode.

See Also:
Graph2DView.setPaintDetailThreshold(double)

GRAPHICS_CONTEXT_KEY

public static final java.awt.RenderingHints.Key GRAPHICS_CONTEXT_KEY
A key whose associated value must be of type GraphicsContext. Graph2DView will register this hint to the Graphics2D instance during rendering.

See Also:
GraphicsContext, Graph2DView.createGraphicsContext(), getGraphicsContext(java.awt.Graphics2D)
Method Detail

getGraphicsContext

public static GraphicsContext getGraphicsContext(java.awt.Graphics2D g)
Convenience method that tries to retrieve the GraphicsContext from the given graphics object. This is done via the GRAPHICS_CONTEXT_KEY.

Parameters:
g - The graphics object to retrieve the context for.
Returns:
The context or null if none was associated with the context.

isSelectionPaintingEnabled

public static boolean isSelectionPaintingEnabled(java.awt.Graphics2D g)
Returns whether or not rendering onto the specified graphics context should take the selection states of the graph elements being painted into account.

Parameters:
g - the graphics context to paint upon.
Returns:
true if the selection states of graph elements have to be taken into account; false otherwise.
See Also:
KEY_SELECTION_PAINTING, VALUE_SELECTION_PAINTING_OFF

isGradientPaintingEnabled

public static boolean isGradientPaintingEnabled(java.awt.Graphics2D g)
Returns whether the rendering onto the specified graphics context should use gradient paints or single colors only.

Parameters:
g - the graphics context to paint upon.
Returns:
false if flat colors should be used instead of gradient paints; true otherwise.
See Also:
KEY_GRADIENT_PAINTING, VALUE_GRADIENT_PAINTING_OFF

isShadowPaintingEnabled

public static boolean isShadowPaintingEnabled(java.awt.Graphics2D g)
Returns whether or not shadows should be rendered onto the specified graphics.

Parameters:
g - the graphics context to paint upon.
Returns:
true if shadows should be rendered; false otherwise.
See Also:
KEY_SHADOW_PAINTING, VALUE_SHADOW_PAINTING_OFF

isSloppyPolylinePaintingEnabled

public static boolean isSloppyPolylinePaintingEnabled(java.awt.Graphics2D g)
Returns whether or not sloppy mode renders edges as polylines onto the specified graphics context.

Parameters:
g - the graphics context to paint upon.
Returns:
true if edges are rendered as polylines in sloppy mode, false otherwise.
See Also:
KEY_SLOPPY_POLYLINE_PAINTING, VALUE_SLOPPY_POLYLINE_PAINTING_OFF

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.