com.mxgraph.swing.handler.mxSelectionCellsHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jgraphx Show documentation
Show all versions of jgraphx Show documentation
JGraphX Swing Component - Java Graph Visualization Library
This is a binary & source redistribution of the original, unmodified JGraphX library originating from:
"https://github.com/jgraph/jgraphx/archive/v3.4.1.3.zip".
The purpose of this redistribution is to make the library available to other Maven projects.
/**
* $Id: mxSelectionCellsHandler.java,v 1.13 2012/07/25 08:23:43 gaudenz Exp $
* Copyright (c) 2008, Gaudenz Alder
*
* Known issue: Drag image size depends on the initial position and may sometimes
* not align with the grid when dragging. This is because the rounding of the width
* and height at the initial position may be different than that at the current
* position as the left and bottom side of the shape must align to the grid lines.
*/
package com.mxgraph.swing.handler;
import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.Stroke;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import javax.swing.SwingUtilities;
import com.mxgraph.swing.mxGraphComponent;
import com.mxgraph.util.mxEvent;
import com.mxgraph.util.mxEventObject;
import com.mxgraph.util.mxEventSource.mxIEventListener;
import com.mxgraph.view.mxCellState;
import com.mxgraph.view.mxGraph;
public class mxSelectionCellsHandler implements MouseListener,
MouseMotionListener
{
/**
*
*/
private static final long serialVersionUID = -882368002120921842L;
/**
* Defines the default value for maxHandlers. Default is 100.
*/
public static int DEFAULT_MAX_HANDLERS = 100;
/**
* Reference to the enclosing graph component.
*/
protected mxGraphComponent graphComponent;
/**
* Specifies if this handler is enabled.
*/
protected boolean enabled = true;
/**
* Specifies if this handler is visible.
*/
protected boolean visible = true;
/**
* Reference to the enclosing graph component.
*/
protected Rectangle bounds = null;
/**
* Defines the maximum number of handlers to paint individually.
* Default is DEFAULT_MAX_HANDLES.
*/
protected int maxHandlers = DEFAULT_MAX_HANDLERS;
/**
* Maps from cells to handlers in the order of the selection cells.
*/
protected transient LinkedHashMap