public class IlvHalfZoomingRenderer extends IlvFilterSDMRenderer
IlvHalfZoomingRenderer
is a
filtering renderer that prevents the nodes of the
graph to zoom in and/or out beyond given limits.
The half-zooming renderer wraps each graphic node created
by the filtered renderer in an
IlvHalfZoomingGraphic
.
The minimum zoom, maximum zoom, initial zoom and rotatable flag are fetched
from the style sheet using the rendering properties
MinZoom
, MaxZoom
, InitialZoom
,
and Rotatable
.
When the view is zoomed in and the zoom level becomes greater than the maximum zoom, the nodes keep a fixed size.
When the view is zoomed out and the zoom level becomes smaller than the minimum zoom, the nodes are replaced by gray boxes. The gray boxes keep getting smaller as the view is zoomed out.
If the minimum zoom is 0
, the objects are zoomed out normally, as if the
half-zooming renderer was not present. Similarly, if the maximum zoom is 0
,
the objects always get bigger when the view is zoomed in, as if the
half-zooming renderer was not present.
For example, with the following CSS rule, the nodes will no longer grow
as soon as the zoom level becomes larger than 4
, and they are grayed out
when the zoom becomes smaller than 0.25
:
SDM { HalfZooming : "true"; } node { MaxZoom : "4"; MinZoom : "0.25"; }
The zoom thresholds can also be set globally for all the nodes
by setting the minZoom
and maxZoom
directly on the renderer, as follows:
SDM { HalfZooming : "true"; } HalfZooming { maxZoom : "4"; minZoom : "0.25"; }
The half zooming renderer supports node alpha transparency. Use this feature to add transparency to specific nodes without changing the individual foreground, background and stroke colors for the node.
For any node, the alpha transparency value must be between 0 and 1. The following CSS rule specifies that certain nodes must appear transparent with an alpha value of 0.3:
SDM { HalfZooming : "true"; } node.MyType { MaxZoom : "4"; MinZoom : "0.25"; Alpha: "0.3"; }
The following CSS rule sets the default alpha transparency for all nodes:
SDM { HalfZooming : "true"; } HalfZooming { alpha : "0.4"; }CSS example:
ilvHalfZoomingRenderer {
class : "ilog.views.sdm.renderer.IlvHalfZoomingRenderer";
alias : "<value>";
alpha : "2.0";
grayedWhenUnzoomed : "false";
initialZoom : "3.0";
maxZoom : "3.0";
minZoom : "3.0";
parameter : "<value>";
rotatable : "false";
unzoomedBackground : "green";
unzoomedForeground : "green";
}
Modifier and Type | Property and Description |
---|---|
java.lang.String |
alias
Sets the alias of this renderer. |
float |
alpha
Changes the alpha transparency value for the objects. |
java.lang.String |
class
Default constructor. |
boolean |
grayedWhenUnzoomed
Specifies whether half-zooming objects are drawn as gray boxes when the zoom level is less than the minimum zoom, or if they are drawn at their minimum size. |
double |
initialZoom
Changes the initial zoom level. |
double |
maxZoom
Changes the maximum zoom level above which the objects stop zooming. |
double |
minZoom
Changes the minimum zoom level below which the objects are replaced by gray boxes. |
java.lang.String |
parameter
This method gives access to a privileged parameter of the renderer, and allows this parameter to be specified quickly in the main option rule of the style sheet. |
boolean |
rotatable
Sets whether the objects support rotation. |
java.awt.Color |
unzoomedBackground
Sets the background color used to fill the nodes below the minimum zoom level. |
java.awt.Color |
unzoomedForeground
Sets the foreground color used to draw the outline of the nodes below the minimum zoom level. |
public java.lang.String class
class : "ilog.views.sdm.renderer.IlvHalfZoomingRenderer";
public java.lang.String alias
SubGraph
or GraphLayout
.
alias : "<value>";
public float alpha
This global alpha transparency value is used as a default
when the Alpha
property has not been set
in the CSS rules for the nodes.
CSS example:
alpha : "2.0";
public boolean grayedWhenUnzoomed
The default value of true
.
CSS example:
grayedWhenUnzoomed : "false";
public double initialZoom
This global initial zoom level is used as a default
when no InitialZoom
property has been set
in the CSS rules for the nodes.
CSS example:
initialZoom : "3.0";
public double maxZoom
This global maximum zoom level is used as a default
when no MaxZoom
property has been set
in the CSS rules for the nodes.
CSS example:
maxZoom : "3.0";
public double minZoom
This global minimum zoom level is used as a default
when no MinZoom
property has been set
in the CSS rules for the nodes.
CSS example:
minZoom : "3.0";
public java.lang.String parameter
For example, the main parameter of the
ilog.views.sdm.renderer.maps.IlvMapRenderer
is the name
of the map file. You can specify that you want to display a
map of the USA by the single declaration:
SDM { Map : "usa.ivl"; }
The default implementation does nothing. Subclasses should
override this method to give access to their main parameter.
CSS example:
parameter : "<value>";
public boolean rotatable
The rotation setting is not delegated to the wrapped object:
rotatable : "false";
public java.awt.Color unzoomedBackground
unzoomedBackground : "green";
public java.awt.Color unzoomedForeground
unzoomedForeground : "green";
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.