本文整理匯總了Java中java.awt.ItemSelectable.getSelectedObjects方法的典型用法代碼示例。如果您正苦於以下問題:Java ItemSelectable.getSelectedObjects方法的具體用法?Java ItemSelectable.getSelectedObjects怎麽用?Java ItemSelectable.getSelectedObjects使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.awt.ItemSelectable
的用法示例。
在下文中一共展示了ItemSelectable.getSelectedObjects方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: actionPerformed
import java.awt.ItemSelectable; //導入方法依賴的package包/類
@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);
}
}
示例2: actionPerformed
import java.awt.ItemSelectable; //導入方法依賴的package包/類
@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);
}
}
示例3: actionPerformed
import java.awt.ItemSelectable; //導入方法依賴的package包/類
@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);
}
示例4: actionPerformed
import java.awt.ItemSelectable; //導入方法依賴的package包/類
@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);
}
示例5: actionPerformed
import java.awt.ItemSelectable; //導入方法依賴的package包/類
@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);
}
示例6: actionPerformed
import java.awt.ItemSelectable; //導入方法依賴的package包/類
@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);
}
示例7: actionPerformed
import java.awt.ItemSelectable; //導入方法依賴的package包/類
@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);
}
示例8: actionPerformed
import java.awt.ItemSelectable; //導入方法依賴的package包/類
@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);
}
示例9: actionPerformed
import java.awt.ItemSelectable; //導入方法依賴的package包/類
@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);
}
示例10: getLabelText
import java.awt.ItemSelectable; //導入方法依賴的package包/類
/**
* @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();
}
示例11: selectedString
import java.awt.ItemSelectable; //導入方法依賴的package包/類
static private String selectedString(ItemSelectable is) {
Object selected[] = is.getSelectedObjects();
return ((selected.length == 0) ? "null" : (String) selected[0]);
}