public LayoutScene(LayoutViewElement mve, LayoutDataObject obj) { super(); this.dataObject = obj; multiview = mve; this.projectPath = FileOwnerQuery.getOwner(obj.getPrimaryFile()).getProjectDirectory().getPath(); this.lSystem = LayoutParser.parse(obj); // addSaveAsCapable(); LayoutDocument ld = lSystem.getDocument(); ld.addPropertyChangeListener(new DocumentDPIChangeListener()); // paper layer this.paperWidget = new PaperWidget(this, ld); // add paper biar bisa diedit2 ic.add(ld); paperLayer.addChild(paperWidget); layerController = LayerFactory.createLayer(this, lSystem.getLayers()); // init em listener ExplorerManager em = layerController.getExplorerManager(); em.addPropertyChangeListener(new NodeSelectionListener()); // main layer, where sublayout widgets will be added mainLayer = layerController.getRootWidget(); addChild(mainLayer); // selection layer, directly above the main layer selectionLayer = new LayerWidget(this); selectionWrapperWidget = new SelectionWrapperWidget(this); selectionLayer.addChild(selectionWrapperWidget); addChild(selectionLayer); // getPriorActions().addAction(new KeySwitchToolAction()); // scene's actions, applied to all selected widgets // key move tool, always available getActions().addAction(KEY_MOVE_ACTION); // move tool createActions(FREE_MOVE_TOOL).addAction(MOVE_ACTION); createActions(ON_AXIS_MOVE_TOOL).addAction(ON_AXIS_MOVE_ACTION); setActiveTool(FREE_MOVE_TOOL); // rotate on outside of selectedwrapper border createActions(SelectionWrapperWidget.TRANSFORM_TOOL).addAction(ROTATE_ACTION); // mirror selected layer, only on transform mode createActions(SelectionWrapperWidget.TRANSFORM_TOOL).addAction(MIRROR_ACTION); // show popup under right click to show layers under cursor getActions().addAction(SELECT_ACTION); getPriorActions().addAction(SCROLL_MODIFIER_ACTION); initLookup(); createView(); }
ImmutableLayoutScene(DataObject obj, LayoutLSystem lSystem) { super(); this.projectPath = FileOwnerQuery.getOwner(obj.getPrimaryFile()).getProjectDirectory().getPath(); LayoutLSystem lSclone = new LayoutLSystem(lSystem); LayoutDocument ld = lSclone.getDocument(); // paper layer this.paperWidget = new PaperWidget(this, ld); paperWidget.drawShadow = false; paperLayer.addChild(paperWidget); LayerController layerController = LayerFactory.createLayer(this, lSclone.getLayers()); // main layer, where sublayout widgets will be added addChild(layerController.getRootWidget()); for (Object o : getObjects()) { Widget w = findWidget(o); if (w instanceof SubLayoutWidget) { SubLayoutWidget slw = (SubLayoutWidget) w; slw.showEmptySquares(false); } } }