下面列出了javax.swing.JComponent#setDoubleBuffered ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* Set double buffering for a component and all of its descendants.
*/
private static void setDoubleBuffered(JComponent jc, boolean b) {
jc.setDoubleBuffered(b);
for (Component c : jc.getComponents()) {
if (c instanceof JComponent)
setDoubleBuffered((JComponent) c, b);
}
}
@Override
public void render(Graphics graphics, int width, int height) {
JComponent renderComponent = getRenderComponent();
renderComponent.setSize(width, height);
renderComponent.setDoubleBuffered(false);
renderComponent.paint(graphics);
renderComponent.setDoubleBuffered(true);
}
/**
* If needed paint dirty region of the snapshot
*
* @param shadowBg
* BufferedImage
* @param layeredPane
* Container
*/
private void paintShadow(final BufferedImage shadowBg, final Container layeredPane) {
final int layeredPaneWidth = layeredPane.getWidth();
final int layeredPaneHeight = layeredPane.getHeight();
if (RECT.x + RECT.width > layeredPaneWidth) {
RECT.width = layeredPaneWidth - RECT.x;
}
if (RECT.y + RECT.height > layeredPaneHeight) {
RECT.height = layeredPaneHeight - RECT.y;
}
if (!RECT.isEmpty()) {
final Graphics g = shadowBg.createGraphics();
g.translate(-RECT.x, -RECT.y);
g.setClip(RECT);
if (layeredPane instanceof JComponent) {
final JComponent c = (JComponent) layeredPane;
final boolean doubleBuffered = c.isDoubleBuffered();
c.setDoubleBuffered(false);
c.paintAll(g);
c.setDoubleBuffered(doubleBuffered);
} else {
layeredPane.paintAll(g);
}
g.dispose();
}
}
/**
* Prepares the component for drawing. This recursively disables the double-buffering as this would interfere with the
* drawing.
*
* @param c
* the component that should be prepared.
*/
private void prepareComponent( final Component c ) {
if ( c instanceof JComponent ) {
final JComponent jc = (JComponent) c;
jc.setDoubleBuffered( false );
final Component[] childs = jc.getComponents();
for ( int i = 0; i < childs.length; i++ ) {
final Component child = childs[i];
prepareComponent( child );
}
}
}
public DiagramScene(Action[] actions, DiagramViewModel model) {
this.actions = actions;
selectedWidgets = new ArrayList<FigureWidget>();
content = new InstanceContent();
lookup = new AbstractLookup(content);
this.setCheckClipping(true);
this.getInputBindings().setZoomActionModifiers(0);
JComponent comp = this.createView();
comp.setDoubleBuffered(true);
comp.setBackground(Color.WHITE);
comp.setOpaque(true);
this.setBackground(Color.WHITE);
this.setOpaque(true);
scrollPane = new JScrollPane(comp);
scrollPane.setBackground(Color.WHITE);
scrollPane.getVerticalScrollBar().setUnitIncrement(SCROLL_UNIT_INCREMENT);
scrollPane.getVerticalScrollBar().setBlockIncrement(SCROLL_BLOCK_INCREMENT);
scrollPane.getHorizontalScrollBar().setUnitIncrement(SCROLL_UNIT_INCREMENT);
scrollPane.getHorizontalScrollBar().setBlockIncrement(SCROLL_BLOCK_INCREMENT);
scrollPane.getViewport().addChangeListener(scrollChangeListener);
hoverAction = this.createWidgetHoverAction();
blockLayer = new LayerWidget(this);
this.addChild(blockLayer);
startLayer = new LayerWidget(this);
this.addChild(startLayer);
// TODO: String startLabelString = "Loading graph with " + originalDiagram.getFigures().size() + " figures and " + originalDiagram.getConnections().size() + " connections...";
String startLabelString = "";
LabelWidget w = new LabelWidget(this, startLabelString);
scrollChangeListener.register(w, new Point(10, 10));
w.setAlignment(LabelWidget.Alignment.CENTER);
startLabel = w;
startLayer.addChild(w);
mainLayer = new LayerWidget(this);
this.addChild(mainLayer);
topLeft = new Widget(this);
topLeft.setPreferredLocation(new Point(-BORDER_SIZE, -BORDER_SIZE));
this.addChild(topLeft);
bottomRight = new Widget(this);
bottomRight.setPreferredLocation(new Point(-BORDER_SIZE, -BORDER_SIZE));
this.addChild(bottomRight);
slotLayer = new LayerWidget(this);
this.addChild(slotLayer);
connectionLayer = new LayerWidget(this);
this.addChild(connectionLayer);
LayerWidget selectionLayer = new LayerWidget(this);
this.addChild(selectionLayer);
this.setLayout(LayoutFactory.createAbsoluteLayout());
this.getActions().addAction(hoverAction);
zoomAction = new BoundedZoomAction(1.1, false);
zoomAction.setMaxFactor(ZOOM_MAX_FACTOR);
zoomAction.setMinFactor(ZOOM_MIN_FACTOR);
this.getActions().addAction(ActionFactory.createMouseCenteredZoomAction(1.1));
panAction = new ExtendedPanAction();
this.getActions().addAction(panAction);
this.getActions().addAction(ActionFactory.createPopupMenuAction(popupMenuProvider));
LayerWidget selectLayer = new LayerWidget(this);
this.addChild(selectLayer);
this.getActions().addAction(ActionFactory.createRectangularSelectAction(rectangularSelectDecorator, selectLayer, rectangularSelectProvider));
blockWidgets = new HashMap<InputBlock, BlockWidget>();
boolean b = this.getUndoRedoEnabled();
this.setUndoRedoEnabled(false);
this.setNewModel(model);
this.setUndoRedoEnabled(b);
}
public DiagramScene(Action[] actions, DiagramViewModel model) {
this.actions = actions;
selectedWidgets = new ArrayList<FigureWidget>();
content = new InstanceContent();
lookup = new AbstractLookup(content);
this.setCheckClipping(true);
this.getInputBindings().setZoomActionModifiers(0);
JComponent comp = this.createView();
comp.setDoubleBuffered(true);
comp.setBackground(Color.WHITE);
comp.setOpaque(true);
this.setBackground(Color.WHITE);
this.setOpaque(true);
scrollPane = new JScrollPane(comp);
scrollPane.setBackground(Color.WHITE);
scrollPane.getVerticalScrollBar().setUnitIncrement(SCROLL_UNIT_INCREMENT);
scrollPane.getVerticalScrollBar().setBlockIncrement(SCROLL_BLOCK_INCREMENT);
scrollPane.getHorizontalScrollBar().setUnitIncrement(SCROLL_UNIT_INCREMENT);
scrollPane.getHorizontalScrollBar().setBlockIncrement(SCROLL_BLOCK_INCREMENT);
scrollPane.getViewport().addChangeListener(scrollChangeListener);
hoverAction = this.createWidgetHoverAction();
blockLayer = new LayerWidget(this);
this.addChild(blockLayer);
startLayer = new LayerWidget(this);
this.addChild(startLayer);
// TODO: String startLabelString = "Loading graph with " + originalDiagram.getFigures().size() + " figures and " + originalDiagram.getConnections().size() + " connections...";
String startLabelString = "";
LabelWidget w = new LabelWidget(this, startLabelString);
scrollChangeListener.register(w, new Point(10, 10));
w.setAlignment(LabelWidget.Alignment.CENTER);
startLabel = w;
startLayer.addChild(w);
mainLayer = new LayerWidget(this);
this.addChild(mainLayer);
topLeft = new Widget(this);
topLeft.setPreferredLocation(new Point(-BORDER_SIZE, -BORDER_SIZE));
this.addChild(topLeft);
bottomRight = new Widget(this);
bottomRight.setPreferredLocation(new Point(-BORDER_SIZE, -BORDER_SIZE));
this.addChild(bottomRight);
slotLayer = new LayerWidget(this);
this.addChild(slotLayer);
connectionLayer = new LayerWidget(this);
this.addChild(connectionLayer);
LayerWidget selectionLayer = new LayerWidget(this);
this.addChild(selectionLayer);
this.setLayout(LayoutFactory.createAbsoluteLayout());
this.getActions().addAction(hoverAction);
zoomAction = new BoundedZoomAction(1.1, false);
zoomAction.setMaxFactor(ZOOM_MAX_FACTOR);
zoomAction.setMinFactor(ZOOM_MIN_FACTOR);
this.getActions().addAction(ActionFactory.createMouseCenteredZoomAction(1.1));
panAction = new ExtendedPanAction();
this.getActions().addAction(panAction);
this.getActions().addAction(ActionFactory.createPopupMenuAction(popupMenuProvider));
LayerWidget selectLayer = new LayerWidget(this);
this.addChild(selectLayer);
this.getActions().addAction(ActionFactory.createRectangularSelectAction(rectangularSelectDecorator, selectLayer, rectangularSelectProvider));
blockWidgets = new HashMap<InputBlock, BlockWidget>();
boolean b = this.getUndoRedoEnabled();
this.setUndoRedoEnabled(false);
this.setNewModel(model);
this.setUndoRedoEnabled(b);
}
public DiagramScene(Action[] actions, DiagramViewModel model) {
this.actions = actions;
selectedWidgets = new ArrayList<FigureWidget>();
content = new InstanceContent();
lookup = new AbstractLookup(content);
this.setCheckClipping(true);
this.getInputBindings().setZoomActionModifiers(0);
JComponent comp = this.createView();
comp.setDoubleBuffered(true);
comp.setBackground(Color.WHITE);
comp.setOpaque(true);
this.setBackground(Color.WHITE);
this.setOpaque(true);
scrollPane = new JScrollPane(comp);
scrollPane.setBackground(Color.WHITE);
scrollPane.getVerticalScrollBar().setUnitIncrement(SCROLL_UNIT_INCREMENT);
scrollPane.getVerticalScrollBar().setBlockIncrement(SCROLL_BLOCK_INCREMENT);
scrollPane.getHorizontalScrollBar().setUnitIncrement(SCROLL_UNIT_INCREMENT);
scrollPane.getHorizontalScrollBar().setBlockIncrement(SCROLL_BLOCK_INCREMENT);
scrollPane.getViewport().addChangeListener(scrollChangeListener);
hoverAction = this.createWidgetHoverAction();
blockLayer = new LayerWidget(this);
this.addChild(blockLayer);
startLayer = new LayerWidget(this);
this.addChild(startLayer);
// TODO: String startLabelString = "Loading graph with " + originalDiagram.getFigures().size() + " figures and " + originalDiagram.getConnections().size() + " connections...";
String startLabelString = "";
LabelWidget w = new LabelWidget(this, startLabelString);
scrollChangeListener.register(w, new Point(10, 10));
w.setAlignment(LabelWidget.Alignment.CENTER);
startLabel = w;
startLayer.addChild(w);
mainLayer = new LayerWidget(this);
this.addChild(mainLayer);
topLeft = new Widget(this);
topLeft.setPreferredLocation(new Point(-BORDER_SIZE, -BORDER_SIZE));
this.addChild(topLeft);
bottomRight = new Widget(this);
bottomRight.setPreferredLocation(new Point(-BORDER_SIZE, -BORDER_SIZE));
this.addChild(bottomRight);
slotLayer = new LayerWidget(this);
this.addChild(slotLayer);
connectionLayer = new LayerWidget(this);
this.addChild(connectionLayer);
LayerWidget selectionLayer = new LayerWidget(this);
this.addChild(selectionLayer);
this.setLayout(LayoutFactory.createAbsoluteLayout());
this.getActions().addAction(hoverAction);
zoomAction = new BoundedZoomAction(1.1, false);
zoomAction.setMaxFactor(ZOOM_MAX_FACTOR);
zoomAction.setMinFactor(ZOOM_MIN_FACTOR);
this.getActions().addAction(ActionFactory.createMouseCenteredZoomAction(1.1));
panAction = new ExtendedPanAction();
this.getActions().addAction(panAction);
this.getActions().addAction(ActionFactory.createPopupMenuAction(popupMenuProvider));
LayerWidget selectLayer = new LayerWidget(this);
this.addChild(selectLayer);
this.getActions().addAction(ActionFactory.createRectangularSelectAction(rectangularSelectDecorator, selectLayer, rectangularSelectProvider));
blockWidgets = new HashMap<InputBlock, BlockWidget>();
boolean b = this.getUndoRedoEnabled();
this.setUndoRedoEnabled(false);
this.setNewModel(model);
this.setUndoRedoEnabled(b);
}
public DiagramScene(Action[] actions, DiagramViewModel model) {
this.actions = actions;
selectedWidgets = new ArrayList<FigureWidget>();
content = new InstanceContent();
lookup = new AbstractLookup(content);
this.setCheckClipping(true);
this.getInputBindings().setZoomActionModifiers(0);
JComponent comp = this.createView();
comp.setDoubleBuffered(true);
comp.setBackground(Color.WHITE);
comp.setOpaque(true);
this.setBackground(Color.WHITE);
this.setOpaque(true);
scrollPane = new JScrollPane(comp);
scrollPane.setBackground(Color.WHITE);
scrollPane.getVerticalScrollBar().setUnitIncrement(SCROLL_UNIT_INCREMENT);
scrollPane.getVerticalScrollBar().setBlockIncrement(SCROLL_BLOCK_INCREMENT);
scrollPane.getHorizontalScrollBar().setUnitIncrement(SCROLL_UNIT_INCREMENT);
scrollPane.getHorizontalScrollBar().setBlockIncrement(SCROLL_BLOCK_INCREMENT);
scrollPane.getViewport().addChangeListener(scrollChangeListener);
hoverAction = this.createWidgetHoverAction();
blockLayer = new LayerWidget(this);
this.addChild(blockLayer);
startLayer = new LayerWidget(this);
this.addChild(startLayer);
// TODO: String startLabelString = "Loading graph with " + originalDiagram.getFigures().size() + " figures and " + originalDiagram.getConnections().size() + " connections...";
String startLabelString = "";
LabelWidget w = new LabelWidget(this, startLabelString);
scrollChangeListener.register(w, new Point(10, 10));
w.setAlignment(LabelWidget.Alignment.CENTER);
startLabel = w;
startLayer.addChild(w);
mainLayer = new LayerWidget(this);
this.addChild(mainLayer);
topLeft = new Widget(this);
topLeft.setPreferredLocation(new Point(-BORDER_SIZE, -BORDER_SIZE));
this.addChild(topLeft);
bottomRight = new Widget(this);
bottomRight.setPreferredLocation(new Point(-BORDER_SIZE, -BORDER_SIZE));
this.addChild(bottomRight);
slotLayer = new LayerWidget(this);
this.addChild(slotLayer);
connectionLayer = new LayerWidget(this);
this.addChild(connectionLayer);
LayerWidget selectionLayer = new LayerWidget(this);
this.addChild(selectionLayer);
this.setLayout(LayoutFactory.createAbsoluteLayout());
this.getActions().addAction(hoverAction);
zoomAction = new BoundedZoomAction(1.1, false);
zoomAction.setMaxFactor(ZOOM_MAX_FACTOR);
zoomAction.setMinFactor(ZOOM_MIN_FACTOR);
this.getActions().addAction(ActionFactory.createMouseCenteredZoomAction(1.1));
panAction = new ExtendedPanAction();
this.getActions().addAction(panAction);
this.getActions().addAction(ActionFactory.createPopupMenuAction(popupMenuProvider));
LayerWidget selectLayer = new LayerWidget(this);
this.addChild(selectLayer);
this.getActions().addAction(ActionFactory.createRectangularSelectAction(rectangularSelectDecorator, selectLayer, rectangularSelectProvider));
blockWidgets = new HashMap<InputBlock, BlockWidget>();
boolean b = this.getUndoRedoEnabled();
this.setUndoRedoEnabled(false);
this.setNewModel(model);
this.setUndoRedoEnabled(b);
}
public DiagramScene(Action[] actions, DiagramViewModel model) {
this.actions = actions;
selectedWidgets = new ArrayList<FigureWidget>();
content = new InstanceContent();
lookup = new AbstractLookup(content);
this.setCheckClipping(true);
this.getInputBindings().setZoomActionModifiers(0);
JComponent comp = this.createView();
comp.setDoubleBuffered(true);
comp.setBackground(Color.WHITE);
comp.setOpaque(true);
this.setBackground(Color.WHITE);
this.setOpaque(true);
scrollPane = new JScrollPane(comp);
scrollPane.setBackground(Color.WHITE);
scrollPane.getVerticalScrollBar().setUnitIncrement(SCROLL_UNIT_INCREMENT);
scrollPane.getVerticalScrollBar().setBlockIncrement(SCROLL_BLOCK_INCREMENT);
scrollPane.getHorizontalScrollBar().setUnitIncrement(SCROLL_UNIT_INCREMENT);
scrollPane.getHorizontalScrollBar().setBlockIncrement(SCROLL_BLOCK_INCREMENT);
scrollPane.getViewport().addChangeListener(scrollChangeListener);
hoverAction = this.createWidgetHoverAction();
blockLayer = new LayerWidget(this);
this.addChild(blockLayer);
startLayer = new LayerWidget(this);
this.addChild(startLayer);
// TODO: String startLabelString = "Loading graph with " + originalDiagram.getFigures().size() + " figures and " + originalDiagram.getConnections().size() + " connections...";
String startLabelString = "";
LabelWidget w = new LabelWidget(this, startLabelString);
scrollChangeListener.register(w, new Point(10, 10));
w.setAlignment(LabelWidget.Alignment.CENTER);
startLabel = w;
startLayer.addChild(w);
mainLayer = new LayerWidget(this);
this.addChild(mainLayer);
topLeft = new Widget(this);
topLeft.setPreferredLocation(new Point(-BORDER_SIZE, -BORDER_SIZE));
this.addChild(topLeft);
bottomRight = new Widget(this);
bottomRight.setPreferredLocation(new Point(-BORDER_SIZE, -BORDER_SIZE));
this.addChild(bottomRight);
slotLayer = new LayerWidget(this);
this.addChild(slotLayer);
connectionLayer = new LayerWidget(this);
this.addChild(connectionLayer);
LayerWidget selectionLayer = new LayerWidget(this);
this.addChild(selectionLayer);
this.setLayout(LayoutFactory.createAbsoluteLayout());
this.getActions().addAction(hoverAction);
zoomAction = new BoundedZoomAction(1.1, false);
zoomAction.setMaxFactor(ZOOM_MAX_FACTOR);
zoomAction.setMinFactor(ZOOM_MIN_FACTOR);
this.getActions().addAction(ActionFactory.createMouseCenteredZoomAction(1.1));
panAction = new ExtendedPanAction();
this.getActions().addAction(panAction);
this.getActions().addAction(ActionFactory.createPopupMenuAction(popupMenuProvider));
LayerWidget selectLayer = new LayerWidget(this);
this.addChild(selectLayer);
this.getActions().addAction(ActionFactory.createRectangularSelectAction(rectangularSelectDecorator, selectLayer, rectangularSelectProvider));
blockWidgets = new HashMap<InputBlock, BlockWidget>();
boolean b = this.getUndoRedoEnabled();
this.setUndoRedoEnabled(false);
this.setNewModel(model);
this.setUndoRedoEnabled(b);
}
public DiagramScene(Action[] actions, DiagramViewModel model) {
this.actions = actions;
selectedWidgets = new ArrayList<FigureWidget>();
content = new InstanceContent();
lookup = new AbstractLookup(content);
this.setCheckClipping(true);
this.getInputBindings().setZoomActionModifiers(0);
JComponent comp = this.createView();
comp.setDoubleBuffered(true);
comp.setBackground(Color.WHITE);
comp.setOpaque(true);
this.setBackground(Color.WHITE);
this.setOpaque(true);
scrollPane = new JScrollPane(comp);
scrollPane.setBackground(Color.WHITE);
scrollPane.getVerticalScrollBar().setUnitIncrement(SCROLL_UNIT_INCREMENT);
scrollPane.getVerticalScrollBar().setBlockIncrement(SCROLL_BLOCK_INCREMENT);
scrollPane.getHorizontalScrollBar().setUnitIncrement(SCROLL_UNIT_INCREMENT);
scrollPane.getHorizontalScrollBar().setBlockIncrement(SCROLL_BLOCK_INCREMENT);
scrollPane.getViewport().addChangeListener(scrollChangeListener);
hoverAction = this.createWidgetHoverAction();
blockLayer = new LayerWidget(this);
this.addChild(blockLayer);
startLayer = new LayerWidget(this);
this.addChild(startLayer);
// TODO: String startLabelString = "Loading graph with " + originalDiagram.getFigures().size() + " figures and " + originalDiagram.getConnections().size() + " connections...";
String startLabelString = "";
LabelWidget w = new LabelWidget(this, startLabelString);
scrollChangeListener.register(w, new Point(10, 10));
w.setAlignment(LabelWidget.Alignment.CENTER);
startLabel = w;
startLayer.addChild(w);
mainLayer = new LayerWidget(this);
this.addChild(mainLayer);
topLeft = new Widget(this);
topLeft.setPreferredLocation(new Point(-BORDER_SIZE, -BORDER_SIZE));
this.addChild(topLeft);
bottomRight = new Widget(this);
bottomRight.setPreferredLocation(new Point(-BORDER_SIZE, -BORDER_SIZE));
this.addChild(bottomRight);
slotLayer = new LayerWidget(this);
this.addChild(slotLayer);
connectionLayer = new LayerWidget(this);
this.addChild(connectionLayer);
LayerWidget selectionLayer = new LayerWidget(this);
this.addChild(selectionLayer);
this.setLayout(LayoutFactory.createAbsoluteLayout());
this.getActions().addAction(hoverAction);
zoomAction = new BoundedZoomAction(1.1, false);
zoomAction.setMaxFactor(ZOOM_MAX_FACTOR);
zoomAction.setMinFactor(ZOOM_MIN_FACTOR);
this.getActions().addAction(ActionFactory.createMouseCenteredZoomAction(1.1));
panAction = new ExtendedPanAction();
this.getActions().addAction(panAction);
this.getActions().addAction(ActionFactory.createPopupMenuAction(popupMenuProvider));
LayerWidget selectLayer = new LayerWidget(this);
this.addChild(selectLayer);
this.getActions().addAction(ActionFactory.createRectangularSelectAction(rectangularSelectDecorator, selectLayer, rectangularSelectProvider));
blockWidgets = new HashMap<InputBlock, BlockWidget>();
boolean b = this.getUndoRedoEnabled();
this.setUndoRedoEnabled(false);
this.setNewModel(model);
this.setUndoRedoEnabled(b);
}
public DiagramScene(Action[] actions, DiagramViewModel model) {
this.actions = actions;
selectedWidgets = new ArrayList<FigureWidget>();
content = new InstanceContent();
lookup = new AbstractLookup(content);
this.setCheckClipping(true);
this.getInputBindings().setZoomActionModifiers(0);
JComponent comp = this.createView();
comp.setDoubleBuffered(true);
comp.setBackground(Color.WHITE);
comp.setOpaque(true);
this.setBackground(Color.WHITE);
this.setOpaque(true);
scrollPane = new JScrollPane(comp);
scrollPane.setBackground(Color.WHITE);
scrollPane.getVerticalScrollBar().setUnitIncrement(SCROLL_UNIT_INCREMENT);
scrollPane.getVerticalScrollBar().setBlockIncrement(SCROLL_BLOCK_INCREMENT);
scrollPane.getHorizontalScrollBar().setUnitIncrement(SCROLL_UNIT_INCREMENT);
scrollPane.getHorizontalScrollBar().setBlockIncrement(SCROLL_BLOCK_INCREMENT);
scrollPane.getViewport().addChangeListener(scrollChangeListener);
hoverAction = this.createWidgetHoverAction();
blockLayer = new LayerWidget(this);
this.addChild(blockLayer);
startLayer = new LayerWidget(this);
this.addChild(startLayer);
// TODO: String startLabelString = "Loading graph with " + originalDiagram.getFigures().size() + " figures and " + originalDiagram.getConnections().size() + " connections...";
String startLabelString = "";
LabelWidget w = new LabelWidget(this, startLabelString);
scrollChangeListener.register(w, new Point(10, 10));
w.setAlignment(LabelWidget.Alignment.CENTER);
startLabel = w;
startLayer.addChild(w);
mainLayer = new LayerWidget(this);
this.addChild(mainLayer);
topLeft = new Widget(this);
topLeft.setPreferredLocation(new Point(-BORDER_SIZE, -BORDER_SIZE));
this.addChild(topLeft);
bottomRight = new Widget(this);
bottomRight.setPreferredLocation(new Point(-BORDER_SIZE, -BORDER_SIZE));
this.addChild(bottomRight);
slotLayer = new LayerWidget(this);
this.addChild(slotLayer);
connectionLayer = new LayerWidget(this);
this.addChild(connectionLayer);
LayerWidget selectionLayer = new LayerWidget(this);
this.addChild(selectionLayer);
this.setLayout(LayoutFactory.createAbsoluteLayout());
this.getActions().addAction(hoverAction);
zoomAction = new BoundedZoomAction(1.1, false);
zoomAction.setMaxFactor(ZOOM_MAX_FACTOR);
zoomAction.setMinFactor(ZOOM_MIN_FACTOR);
this.getActions().addAction(ActionFactory.createMouseCenteredZoomAction(1.1));
panAction = new ExtendedPanAction();
this.getActions().addAction(panAction);
this.getActions().addAction(ActionFactory.createPopupMenuAction(popupMenuProvider));
LayerWidget selectLayer = new LayerWidget(this);
this.addChild(selectLayer);
this.getActions().addAction(ActionFactory.createRectangularSelectAction(rectangularSelectDecorator, selectLayer, rectangularSelectProvider));
blockWidgets = new HashMap<InputBlock, BlockWidget>();
boolean b = this.getUndoRedoEnabled();
this.setUndoRedoEnabled(false);
this.setNewModel(model);
this.setUndoRedoEnabled(b);
}