private void highlightUntransformed() { AutomatonEditorPanel<T, S> panel = getEditorPanel(); clearSelection(); for (S trans : myAlg.getUnconvertedTransitions()) panel.selectObject(trans); highlightOtherObjects(); }
private void initView() { AutomatonEditorPanel<T, S> panel = getEditorPanel(); T auto = panel.getAutomaton(); initTable(myAlg.getConvertedGrammar(), new UndoKeeper()); panel.setTool(createArrowTool(panel, auto)); MagnifiableScrollPane scroll = new MagnifiableScrollPane(myTable); scroll.setMinimumSize(myTable.getMinimumSize()); JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, panel, scroll); Dimension size = getPreferredSize(), scrollSize = myTable.getMinimumSize(); double width = size.width + scrollSize.width; split.setPreferredSize(new Dimension((int) width, size.height)); double ratio = size.width / width; split.setDividerLocation(ratio); split.setResizeWeight(ratio); SizeSlider slider = new SizeSlider(scroll); JToolBar toolbar = initToolbar(); add(split, BorderLayout.CENTER); add(slider, BorderLayout.SOUTH); add(toolbar, BorderLayout.NORTH); slider.distributeMagnification(); size = new Dimension( (int) width, size.height + slider.getPreferredSize().height + toolbar.getPreferredSize().height); setPreferredSize(size); }
private void changeSelection() { ListSelectionModel model = myTable.getSelectionModel(); AutomatonEditorPanel<T, S> panel = getEditorPanel(); panel.clearSelection(); int min = model.getMinSelectionIndex(), max = model.getMaxSelectionIndex(); if (min < 0) return; for (int i = min; i <= max; i++) if (model.isSelectedIndex(i) && myObjectMap.containsKey(i)) panel.selectObject(myObjectMap.get(i)); }