public class IlvMagnifySymbolsInteractor extends IlvMagnifyInteractor
IlvMagnifySymbolsInteractor magInteractor=new IlvMagnifySymbolsInteractor(); view.setInteractor(magInteractor);When a symbol needs to be displaced because it overlaps with another one, the interactor draws a connecting line and places a marker at the true position. You can change the default markers and lines using code such as the following:
IlvArrowLine lineTemplate = new IlvArrowLine(); lineTemplate.setForeground(Color.red); lineTemplate.setLineWidth(2); lineTemplate.setArrowPosition(1);or, to set up a specific marker:
IlvMarker markerTemplate = new IlvMarker(); markerTemplate.setType(IlvMarker.IlvMarkerFilledCircle); markerTemplate.setForeground(Color.orange); markerTemplate.setSize(2); magInteractor.setTargetMarkerTemplate(markerTemplate);The displacement is done through an
IlvAnnealingLabelLayout
that you can configure. For example, if you want
all the symbols to move, even when not necessary, you can call:magInteractor.getAnnealingLabelLayout().setLabelMovementPolicy(null);
CIRCULAR, LENS, RECTANGULAR
Constructor and Description |
---|
IlvMagnifySymbolsInteractor()
Creates a new
IlvMagnifySymbolsInteractor . |
Modifier and Type | Method and Description |
---|---|
protected void |
drawMagnifier(Graphics g)
Draws the magnifier.
|
IlvAnnealingLabelLayout |
getAnnealingLabelLayout()
Returns the layout used to remove the symbol clutter.
|
IlvLine |
getConnectingLineTemplate()
Returns the graphical object used to draw the connecting line.
|
double |
getSymbolFactor()
Returns the scale factor to be used to display symbols inside the interactor view.
|
IlvMarker |
getTargetMarkerTemplate()
Returns the graphical object used to draw the target point.
|
void |
setAnnealingLabelLayout(IlvAnnealingLabelLayout annealingLabelLayout)
Sets a different annealing label layout to remove the symbol clutter.
|
void |
setConnectingLineTemplate(IlvLine connectingLineTemplate)
Sets a customized line for drawing the connecting line.
|
void |
setSymbolFactor(double symbolFactor)
Sets the scale factor to be used to display symbols inside the interactor view.
|
void |
setTargetMarkerTemplate(IlvMarker targetMarkerTemplate)
Sets a customized marker for drawing the target point.
|
protected void |
update()
Called by
IlvMagnifyInteractor.handleExpose(Graphics) when it becomes necessary to update the magnified view. |
attach, detach, getDrawingRect, getFactor, getFrameColor, getMode, getSize, handleExpose, isPermanent, processMouseEvent, processMouseMotionEvent, setFactor, setFrameColor, setMode, setPermanent, setSize
addFocusListener, addKeyListener, addMouseListener, addMouseMotionListener, allowEnsureVisible, allowEnsureVisible, disableEvents, drawGhost, drawGhost, enableEvents, ensureVisible, ensureVisible, getManager, getManagerView, getTransformer, isXORGhost, processEvent, processFocusEvent, processKeyEvent, removeFocusListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, setXORGhost
public IlvMagnifySymbolsInteractor()
IlvMagnifySymbolsInteractor
.
By default, the zoom factor is 1, the symbol factor 0.8, and the size 256 pixels.public double getSymbolFactor()
public void setSymbolFactor(double symbolFactor)
symbolFactor
- The scale factor.protected void update()
IlvMagnifyInteractor.handleExpose(Graphics)
when it becomes necessary to update the magnified view.update
in class IlvMagnifyInteractor
IlvMagnifyInteractor.update()
protected void drawMagnifier(Graphics g)
IlvMagnifyInteractor.getDrawingRect()
method to return a rectangle containing
the additional drawings.drawMagnifier
in class IlvMagnifyInteractor
g
- The view graphics.IlvMagnifyInteractor.drawMagnifier(java.awt.Graphics)
public IlvLine getConnectingLineTemplate()
public void setConnectingLineTemplate(IlvLine connectingLineTemplate)
connectingLineTemplate
- The line template to use.public IlvMarker getTargetMarkerTemplate()
public void setTargetMarkerTemplate(IlvMarker targetMarkerTemplate)
targetMarkerTemplate
- The marker to use.public IlvAnnealingLabelLayout getAnnealingLabelLayout()
annealingLabelLayout
.public void setAnnealingLabelLayout(IlvAnnealingLabelLayout annealingLabelLayout)
annealingLabelLayout
- The layout to set.© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.