Java 类java.awt.ItemSelectable 实例源码

项目:PasswordSafe    文件:InputTracker.java   
public void add(JComponent c)
{
    if(c instanceof JTextComponent)
    {
        JTextComponent tc = (JTextComponent)c;
        tc.getDocument().addDocumentListener(this);
        tc.addPropertyChangeListener(PROPERTY_DOCUMENT, this);
    }
    else if(c instanceof ItemSelectable)
    {
        ((ItemSelectable)c).addItemListener(this);
    }
    else
    {
        throw new Rex("ignored: " + c);
    }
}
项目:ET_Redux    文件:CheckBoxNodeEditor.java   
/**
 *
 * @param tree
 * @param value
 * @param selected
 * @param expanded
 * @param leaf
 * @param row
 * @return
 */
@Override
public Component getTreeCellEditorComponent(JTree tree, Object value, boolean selected,
        boolean expanded, boolean leaf, int row) {

    Component editor = renderer.getTreeCellRendererComponent(tree, value, true, expanded, leaf,
            row, true);

    ItemListener itemListener = (ItemEvent itemEvent) -> {
        if (stopCellEditing()) {
            fireEditingStopped();
        }
    };
    if (editor instanceof JCheckBox) {
        ((ItemSelectable) editor).addItemListener(itemListener);
    }
    return editor;
}
项目:svarog    文件:BookFilterSwitchAction.java   
@Override
public void actionPerformed(ActionEvent ev) {

    logger.debug("Filter switch");

    BookDocument bookDocument = getActionFocusSelector().getActiveBookDocument();
    if (bookDocument == null) {
        logger.warn("Target document doesn't exist or is not a book");
        return;
    }

    ItemSelectable button = (ItemSelectable) ev.getSource();
    Object[] selectedObjects = button.getSelectedObjects();
    boolean selected = (selectedObjects != null && selectedObjects.length != 0);

    putValue(SELECTED_KEY, new Boolean(selected));
    AtomFilterChain chain = bookDocument.getFilterChain();
    if (selected != chain.isFilteringEnabled()) {
        chain = new AtomFilterChain(chain);
        chain.setFilteringEnabled(selected);
        bookDocument.setFilterChain(chain);
    }

}
项目:svarog    文件:SignalFilterSwitchAction.java   
@Override
public void actionPerformed(ActionEvent ev) {

    logger.debug("Filter switch");

    SignalDocument signalDocument = getActionFocusSelector().getActiveSignalDocument();
    if (signalDocument == null) {
        logger.warn("Target document doesn't exist or is not a signal");
        return;
    }

    ItemSelectable button = (ItemSelectable) ev.getSource();
    Object[] selectedObjects = button.getSelectedObjects();
    boolean selected = (selectedObjects != null && selectedObjects.length != 0);

    putValue(SELECTED_KEY, new Boolean(selected));
    Montage montage = signalDocument.getMontage();
    if (selected != montage.isFilteringEnabled()) {
        montage = new Montage(montage);
        montage.setFilteringEnabled(selected);
        signalDocument.setMontage(montage);
    }

}
项目:svarog    文件:ShowMainToolBarAction.java   
@Override
public void actionPerformed(ActionEvent ev) {

    logger.debug("Show main toolbar");

    ItemSelectable button = (ItemSelectable) ev.getSource();
    Object[] selectedObjects = button.getSelectedObjects();
    boolean selected = (selectedObjects != null && selectedObjects.length != 0);
    putValue(SELECTED_KEY, new Boolean(selected));

    ViewFocusSelector viewFocusSelector = (ViewFocusSelector) findFocusSelector(ev.getSource(), ViewFocusSelector.class);
    if (viewFocusSelector == null) {
        logger.warn("No view selector");
        return;
    }
    View view = viewFocusSelector.getActiveView();
    if (view == null) {
        logger.warn("No view");
        return;
    }

    view.setMainToolBarVisible(selected);

}
项目:svarog    文件:ShowLeftPanelAction.java   
@Override
public void actionPerformed(ActionEvent ev) {

    logger.debug("Show left panel");

    ItemSelectable button = (ItemSelectable) ev.getSource();
    Object[] selectedObjects = button.getSelectedObjects();
    boolean selected = (selectedObjects != null && selectedObjects.length != 0);
    putValue(SELECTED_KEY, new Boolean(selected));

    ViewFocusSelector viewFocusSelector = (ViewFocusSelector) findFocusSelector(ev.getSource(), ViewFocusSelector.class);
    if (viewFocusSelector == null) {
        return;
    }
    View view = viewFocusSelector.getActiveView();
    if (view == null) {
        return;
    }

    view.setLeftPanelVisible(selected);

}
项目:svarog    文件:ShowBottomPanelAction.java   
@Override
public void actionPerformed(ActionEvent ev) {

    logger.debug("Show bottom panel");

    ItemSelectable button = (ItemSelectable) ev.getSource();
    Object[] selectedObjects = button.getSelectedObjects();
    boolean selected = (selectedObjects != null && selectedObjects.length != 0);
    putValue(SELECTED_KEY, new Boolean(selected));

    ViewFocusSelector viewFocusSelector = (ViewFocusSelector) findFocusSelector(ev.getSource(), ViewFocusSelector.class);
    if (viewFocusSelector == null) {
        return;
    }
    View view = viewFocusSelector.getActiveView();
    if (view == null) {
        return;
    }

    view.setBottomPanelVisible(selected);

}
项目:svarog    文件:ViewModeAction.java   
@Override
public void actionPerformed(ActionEvent ev) {

    logger.debug("Maximize documents");

    ItemSelectable button = (ItemSelectable) ev.getSource();
    Object[] selectedObjects = button.getSelectedObjects();
    boolean selected = (selectedObjects != null && selectedObjects.length != 0);
    putValue(SELECTED_KEY, new Boolean(selected));

    ViewFocusSelector viewFocusSelector = (ViewFocusSelector) findFocusSelector(ev.getSource(), ViewFocusSelector.class);
    if (viewFocusSelector == null) {
        return;
    }
    View view = viewFocusSelector.getActiveView();
    if (view == null) {
        return;
    }

    view.setViewMode(selected);

}
项目:svarog    文件:ShowStatusBarAction.java   
@Override
public void actionPerformed(ActionEvent ev) {

    logger.debug("Show status bar");

    ItemSelectable button = (ItemSelectable) ev.getSource();
    Object[] selectedObjects = button.getSelectedObjects();
    boolean selected = (selectedObjects != null && selectedObjects.length != 0);
    putValue(SELECTED_KEY, new Boolean(selected));

    ViewFocusSelector viewFocusSelector = (ViewFocusSelector) findFocusSelector(ev.getSource(), ViewFocusSelector.class);
    if (viewFocusSelector == null) {
        return;
    }
    View view = viewFocusSelector.getActiveView();
    if (view == null) {
        return;
    }

    view.setStatusBarVisible(selected);

}
项目:svarog    文件:SnapToPageAction.java   
@Override
public void actionPerformed(ActionEvent ev) {

    logger.debug("Snap to page");

    SignalDocument signalDocument = getActionFocusSelector().getActiveSignalDocument();
    if (signalDocument == null) {
        logger.warn("Target document doesn't exist or is not a signal");
        return;
    }

    SignalView view = (SignalView) signalDocument.getDocumentView();

    ItemSelectable button = (ItemSelectable) ev.getSource();
    Object[] selectedObjects = button.getSelectedObjects();
    boolean selected = (selectedObjects != null && selectedObjects.length != 0);
    putValue(SELECTED_KEY, new Boolean(selected));

    view.setSnapToPageMode(selected);

}
项目:svarog    文件:DisplayClockTimeAction.java   
@Override
public void actionPerformed(ActionEvent ev) {
    SignalDocument signalDocument = getActionFocusSelector().getActiveSignalDocument();
    if (signalDocument == null) {
        logger.warn("Target document doesn't exist or is not a signal");
        return;
    }

    SignalView view = (SignalView) signalDocument.getDocumentView();

    ItemSelectable button = (ItemSelectable) ev.getSource();
    Object[] selectedObjects = button.getSelectedObjects();
    boolean selected = (selectedObjects != null && selectedObjects.length != 0);
    putValue(SELECTED_KEY, new Boolean(selected));

    view.setDisplayClockTime(selected);
}
项目:incubator-netbeans    文件:BasicSearchForm.java   
@Override
public void itemStateChanged(ItemEvent e) {
    ItemSelectable is = e.getItemSelectable();
    if (is == matchCase) {
        matchCaseChanged();
    } else if (is == textToFindType) {
        regexpChanged();
    }
}
项目:OpenDiabetes    文件:Transfer.java   
/**
 * Method declaration
 *
 *
 * @param e
 */
public void itemStateChanged(ItemEvent e) {

    ItemSelectable item = e.getItemSelectable();

    if (item == lTable) {
        if (iSelectionStep == SELECT_SOURCE_TABLES) {
            String table    = lTable.getSelectedItem();
            int    selected = ((Integer) e.getItem()).intValue();

            for (int i = 0; i < tTable.size(); i++) {
                TransferTable t = (TransferTable) tTable.elementAt(i);

                if (t == null) {
                    continue;
                }

                if (i == selected) {
                    saveTable();
                    displayTable(t);
                    updateEnabled(true);
                }
            }
        }
    } else {

        // it must be a checkbox
        saveTable();
        updateEnabled(true);
    }
}
项目:sstore-soft    文件:Transfer.java   
/**
 * Method declaration
 *
 *
 * @param e
 */
public void itemStateChanged(ItemEvent e) {

    ItemSelectable item = e.getItemSelectable();

    if (item == lTable) {
        if (iSelectionStep == SELECT_SOURCE_TABLES) {
            String table    = lTable.getSelectedItem();
            int    selected = ((Integer) e.getItem()).intValue();

            for (int i = 0; i < tTable.size(); i++) {
                TransferTable t = (TransferTable) tTable.elementAt(i);

                if (t == null) {
                    continue;
                }

                if (i == selected) {
                    saveTable();
                    displayTable(t);
                    updateEnabled(true);
                }
            }
        }
    } else {

        // it must be a checkbox
        saveTable();
        updateEnabled(true);
    }
}
项目:RxJava2Swing    文件:ItemEventObservable.java   
@Override
protected void subscribeActual(Observer<? super ItemEvent> observer) {
    ItemSelectable w = widget;

    ItemEventConsumer aec = new ItemEventConsumer(observer, w);
    observer.onSubscribe(aec);

    w.addItemListener(aec);
    if (aec.get() == null) {
        aec.onDispose(w);
    }
}
项目:s-store    文件:Transfer.java   
/**
 * Method declaration
 *
 *
 * @param e
 */
public void itemStateChanged(ItemEvent e) {

    ItemSelectable item = e.getItemSelectable();

    if (item == lTable) {
        if (iSelectionStep == SELECT_SOURCE_TABLES) {
            String table    = lTable.getSelectedItem();
            int    selected = ((Integer) e.getItem()).intValue();

            for (int i = 0; i < tTable.size(); i++) {
                TransferTable t = (TransferTable) tTable.elementAt(i);

                if (t == null) {
                    continue;
                }

                if (i == selected) {
                    saveTable();
                    displayTable(t);
                    updateEnabled(true);
                }
            }
        }
    } else {

        // it must be a checkbox
        saveTable();
        updateEnabled(true);
    }
}
项目:dev-courses    文件:Transfer.java   
/**
 * Method declaration
 *
 *
 * @param e
 */
public void itemStateChanged(ItemEvent e) {

    ItemSelectable item = e.getItemSelectable();

    if (item == lTable) {
        if (iSelectionStep == SELECT_SOURCE_TABLES) {
            String table    = lTable.getSelectedItem();
            int    selected = ((Integer) e.getItem()).intValue();

            for (int i = 0; i < tTable.size(); i++) {
                TransferTable t = (TransferTable) tTable.elementAt(i);

                if (t == null) {
                    continue;
                }

                if (i == selected) {
                    saveTable();
                    displayTable(t);
                    updateEnabled(true);
                }
            }
        }
    } else {

        // it must be a checkbox
        saveTable();
        updateEnabled(true);
    }
}
项目:parabuild-ci    文件:Transfer.java   
/**
 * Method declaration
 *
 *
 * @param e
 */
public void itemStateChanged(ItemEvent e) {

    ItemSelectable item = e.getItemSelectable();

    if (item == lTable) {
        if (iSelectionStep == SELECT_SOURCE_TABLES) {
            String table    = lTable.getSelectedItem();
            int    selected = ((Integer) e.getItem()).intValue();

            for (int i = 0; i < tTable.size(); i++) {
                TransferTable t = (TransferTable) tTable.elementAt(i);

                if (t == null) {
                    continue;
                }

                if (i == selected) {
                    saveTable();
                    displayTable(t);
                    updateEnabled(true);
                }
            }
        }
    } else {

        // it must be a checkbox
        saveTable();
        updateEnabled(true);
    }
}
项目:parabuild-ci    文件:Transfer.java   
/**
 * Method declaration
 *
 *
 * @param e
 */
public void itemStateChanged(ItemEvent e) {

    ItemSelectable item = e.getItemSelectable();

    if (item == lTable) {
        if (iSelectionStep == SELECT_SOURCE_TABLES) {
            String table    = lTable.getSelectedItem();
            int    selected = ((Integer) e.getItem()).intValue();

            for (int i = 0; i < tTable.size(); i++) {
                TransferTable t = (TransferTable) tTable.elementAt(i);

                if (t == null) {
                    continue;
                }

                if (i == selected) {
                    saveTable();
                    displayTable(t);
                    updateEnabled(true);
                }
            }
        }
    } else {

        // it must be a checkbox
        saveTable();
        updateEnabled(true);
    }
}
项目:parabuild-ci    文件:Transfer.java   
/**
 * Method declaration
 *
 *
 * @param e
 */
public void itemStateChanged(ItemEvent e) {

    ItemSelectable item = e.getItemSelectable();

    if (item == lTable) {
        if (iSelectionStep == SELECT_SOURCE_TABLES) {
            String table    = lTable.getSelectedItem();
            int    selected = ((Integer) e.getItem()).intValue();

            for (int i = 0; i < tTable.size(); i++) {
                TransferTable t = (TransferTable) tTable.elementAt(i);

                if (t == null) {
                    continue;
                }

                if (i == selected) {
                    saveTable();
                    displayTable(t);
                    updateEnabled(true);
                }
            }
        }
    } else {

        // it must be a checkbox
        saveTable();
        updateEnabled(true);
    }
}
项目:parabuild-ci    文件:Transfer.java   
/**
 * Method declaration
 *
 *
 * @param e
 */
public void itemStateChanged(ItemEvent e) {

    ItemSelectable item = e.getItemSelectable();

    if (item == lTable) {
        if (iSelectionStep == SELECT_SOURCE_TABLES) {
            String table    = lTable.getSelectedItem();
            int    selected = ((Integer) e.getItem()).intValue();

            for (int i = 0; i < tTable.size(); i++) {
                TransferTable t = (TransferTable) tTable.elementAt(i);

                if (t == null) {
                    continue;
                }

                if (i == selected) {
                    saveTable();
                    displayTable(t);
                    updateEnabled(true);
                }
            }
        }
    } else {

        // it must be a checkbox
        saveTable();
        updateEnabled(true);
    }
}
项目:javify    文件:GtkCheckboxMenuItemPeer.java   
/**
 * Called from the signal handler of the gtk widget.  Posts a
 * ItemEvent to indicate a state changed, then calls super to post
 * an ActionEvent.
 */
protected void postMenuActionEvent ()
{
  CheckboxMenuItem item = (CheckboxMenuItem)awtWidget;
  q().postEvent (new ItemEvent ((ItemSelectable)awtWidget,
    ItemEvent.ITEM_STATE_CHANGED,
    item.getActionCommand(),
    item.getState() ? ItemEvent.DESELECTED : ItemEvent.SELECTED));

  super.postMenuActionEvent();
}
项目:eurocarbdb    文件:LoginCredentialsPanel.java   
public void itemStateChanged(ItemEvent e) {
    ItemSelectable source = e.getItemSelectable();
    if (source == useDevPayCheckBox) {
        for (int i = 0; i < awsDevPayComponents.length; i++) {
            awsDevPayComponents[i].setVisible(useDevPayCheckBox.isSelected());
        }
    }
}
项目:jvm-stm    文件:GtkCheckboxMenuItemPeer.java   
/**
 * Called from the signal handler of the gtk widget.  Posts a
 * ItemEvent to indicate a state changed, then calls super to post
 * an ActionEvent.
 */
protected void postMenuActionEvent ()
{
  CheckboxMenuItem item = (CheckboxMenuItem)awtWidget;
  q().postEvent (new ItemEvent ((ItemSelectable)awtWidget,
    ItemEvent.ITEM_STATE_CHANGED,
    item.getActionCommand(),
    item.getState() ? ItemEvent.DESELECTED : ItemEvent.SELECTED));

  super.postMenuActionEvent();
}
项目:VoltDB    文件:Transfer.java   
/**
 * Method declaration
 *
 *
 * @param e
 */
public void itemStateChanged(ItemEvent e) {

    ItemSelectable item = e.getItemSelectable();

    if (item == lTable) {
        if (iSelectionStep == SELECT_SOURCE_TABLES) {
            String table    = lTable.getSelectedItem();
            int    selected = ((Integer) e.getItem()).intValue();

            for (int i = 0; i < tTable.size(); i++) {
                TransferTable t = (TransferTable) tTable.elementAt(i);

                if (t == null) {
                    continue;
                }

                if (i == selected) {
                    saveTable();
                    displayTable(t);
                    updateEnabled(true);
                }
            }
        }
    } else {

        // it must be a checkbox
        saveTable();
        updateEnabled(true);
    }
}
项目:metasfresh    文件:SwingTool.java   
protected static boolean isIgnoredComponent(Component c) {

    boolean retVal = true;

    if(c instanceof ItemSelectable && c.isEnabled()) {

        retVal = false;
    }
    else if(c instanceof JTextComponent && c.isEnabled()) {

        retVal = false;
    }
    else if(c instanceof JFrame && c.isEnabled()) {

        retVal = false;
    }
    else if(c instanceof JPanel && c.isEnabled()) {

        retVal = false;
    }
    else if(c instanceof JLabel && c.isEnabled()) {

        retVal = false;
    }
    else if(c instanceof Adjustable && c.isEnabled()) {

        retVal = false;
    }

    return retVal;
}
项目:hipster    文件:Controller.java   
private void bindImpl(Object target, String targetProperty,
        ItemSelectable is, String itemProperty) {
    is.addItemListener(
            (ItemListener) EventHandler.create(
            ItemListener.class,
            target,
            targetProperty,
            "source." + itemProperty
            )
            );
}
项目:Pegasus    文件:Transfer.java   
/**
 * Method declaration
 *
 *
 * @param e
 */
public void itemStateChanged(ItemEvent e) {

    ItemSelectable item = e.getItemSelectable();

    if (item == lTable) {
        if (iSelectionStep == SELECT_SOURCE_TABLES) {
            String table    = lTable.getSelectedItem();
            int    selected = ((Integer) e.getItem()).intValue();

            for (int i = 0; i < tTable.size(); i++) {
                TransferTable t = (TransferTable) tTable.elementAt(i);

                if (t == null) {
                    continue;
                }

                if (i == selected) {
                    saveTable();
                    displayTable(t);
                    updateEnabled(true);
                }
            }
        }
    } else {

        // it must be a checkbox
        saveTable();
        updateEnabled(true);
    }
}
项目:svarog    文件:SignalPlotColumnHeader.java   
public void actionPerformed(ActionEvent ev) {

            Object source = ev.getSource();
            if (source instanceof ItemSelectable) {
                setSelected(((ItemSelectable) source).getSelectedObjects() != null);
            }

        }
项目:FAO_Application    文件:GUIClass.java   
@Override
public void itemStateChanged(ItemEvent e) {
    ItemSelectable chb = e.getItemSelectable();

    if(e.getStateChange() == ItemEvent.SELECTED){
        resetLeftComponentColor();
        selectLeftComponent(chb);
    }
}
项目:FAO_Application    文件:GUIClass.java   
private void selectLeftComponent(ItemSelectable checkbox) {
    if (checkbox == chbGreenness) {
        enablePanel(greennessLeftPan);
        panelSelected=greennessLeftPan;
        greennessLeftPan.setBackground(GUIConstants.COLOR_OVERLAY);
        chbGreenness.setBackground(GUIConstants.COLOR_OVERLAY);
    } else if (checkbox == chbRainfall) {
        enablePanel(rainfallLeftPan);
        panelSelected=rainfallLeftPan;
        rainfallLeftPan.setBackground(GUIConstants.COLOR_OVERLAY);
        chbRainfall.setBackground(GUIConstants.COLOR_OVERLAY);
    } else if (checkbox == chbTPC) {
            enablePanel(tpcLeftPan);
            panelSelected=tpcLeftPan;
            tpcLeftPan.setBackground(GUIConstants.COLOR_BACKGROUND);
            chbTPC.setBackground(GUIConstants.COLOR_BACKGROUND);
    } else if (checkbox == chbLandSat) {
            enablePanel(landsatLeftPan);
            panelSelected=landsatLeftPan;
            landsatLeftPan.setBackground(GUIConstants.COLOR_BACKGROUND);
            chbLandSat.setBackground(GUIConstants.COLOR_BACKGROUND);
    } else if (checkbox == chbElev){
            enablePanel(elevationLeftPan);
            panelSelected=elevationLeftPan;
            elevationLeftPan.setBackground(GUIConstants.COLOR_ELEVATION);
            chbElev.setBackground(GUIConstants.COLOR_ELEVATION);
    } else if (checkbox == chbBound){
            enablePanel(boundariesLeftPan);
            panelSelected=boundariesLeftPan;
            boundariesLeftPan.setBackground(GUIConstants.COLOR_BOUNDARIES);
            chbBound.setBackground(GUIConstants.COLOR_BOUNDARIES);
    }
}
项目:JamVM-PH    文件:GtkCheckboxMenuItemPeer.java   
/**
 * Called from the signal handler of the gtk widget.  Posts a
 * ItemEvent to indicate a state changed, then calls super to post
 * an ActionEvent.
 */
protected void postMenuActionEvent ()
{
  CheckboxMenuItem item = (CheckboxMenuItem)awtWidget;
  q().postEvent (new ItemEvent ((ItemSelectable)awtWidget,
    ItemEvent.ITEM_STATE_CHANGED,
    item.getActionCommand(),
    item.getState() ? ItemEvent.DESELECTED : ItemEvent.SELECTED));

  super.postMenuActionEvent();
}
项目:jets3t-aws-roles    文件:LoginCredentialsPanel.java   
public void itemStateChanged(ItemEvent e) {
    ItemSelectable source = e.getItemSelectable();
    if (source == useDevPayCheckBox) {
        for (int i = 0; i < awsDevPayComponents.length; i++) {
            awsDevPayComponents[i].setVisible(useDevPayCheckBox.isSelected());
        }
    }
}
项目:latexdraw-mutants    文件:ShapePropertyCustomiser.java   
/**
 * @return The selected text. Can be null.
 * @since 3.0
 */
protected String getLabelText() {
    final ItemSelectable is  = interaction.getList();
    final Object[] selection = is.getSelectedObjects();

    return selection.length!=1 && ! (selection[0] instanceof JLabel) ? null : ((JLabel)selection[0]).getText();
}
项目:latexdraw-mutants    文件:ShapeBorderCustomiser.java   
@Override
public void initAction() {
    final ItemSelectable is = interaction.getList();
    action.setPencil(instrument.pencil);

    if(is==instrument.bordersPosCB) {
        action.setProperty(ShapeProperties.BORDER_POS);
        action.setValue(BorderPos.getStyle(getLabelText()));
    } else {
        action.setProperty(ShapeProperties.LINE_STYLE);
        action.setValue(LineStyle.getStyle(getLabelText()));
    }
}
项目:latexdraw-mutants    文件:ShapeBorderCustomiser.java   
@Override
public void initAction() {
    final ItemSelectable is = interaction.getList();
    action.setGroup((IGroup)instrument.pencil.canvas.getDrawing().getSelection().duplicate());

    if(is==instrument.bordersPosCB) {
        action.setProperty(ShapeProperties.BORDER_POS);
        action.setValue(BorderPos.getStyle(getLabelText()));
    }else {
        action.setProperty(ShapeProperties.LINE_STYLE);
        action.setValue(LineStyle.getStyle(getLabelText()));
    }
}
项目:latexdraw-mutants    文件:ShapePropertyCustomiser.java   
/**
 * @return The selected text. Can be null.
 * @since 3.0
 */
protected String getLabelText() {
    final ItemSelectable is  = interaction.getList();
    final Object[] selection = is.getSelectedObjects();

    return selection.length!=1 && ! (selection[0] instanceof JLabel) ? null : ((JLabel)selection[0]).getText();
}
项目:latexdraw-mutants    文件:ShapePropertyCustomiser.java   
/**
 * @return The selected text. Can be null.
 * @since 3.0
 */
protected String getLabelText() {
    final ItemSelectable is  = interaction.getList();
    final Object[] selection = is.getSelectedObjects();

    return selection.length!=1 && ! (selection[0] instanceof JLabel) ? null : ((JLabel)selection[0]).getText();
}
项目:latexdraw-mutants    文件:ShapeBorderCustomiser.java   
@Override
public void initAction() {
    final ItemSelectable is = interaction.getList();
    action.setGroup((IGroup)instrument.pencil.canvas.getDrawing().getSelection().duplicate());

    if(is==instrument.bordersPosCB) {
        action.setProperty(ShapeProperties.BORDER_POS);
        action.setValue(BorderPos.getStyle(getLabelText()));
    }else {
        action.setProperty(ShapeProperties.LINE_STYLE);
        action.setValue(LineStyle.getStyle(getLabelText()));
    }
}
项目:latexdraw-mutants    文件:ShapeBorderCustomiser.java   
@Override
public void initAction() {
    final ItemSelectable is = interaction.getList();
    action.setGroup((IGroup)instrument.pencil.canvas.getDrawing().getSelection().duplicate());

    if(is==instrument.bordersPosCB) {
        action.setProperty(ShapeProperties.BORDER_POS);
        action.setValue(BorderPos.getStyle(getLabelText()));
    }else {
        action.setProperty(ShapeProperties.LINE_STYLE);
        action.setValue(LineStyle.getStyle(getLabelText()));
    }
}