本文整理汇总了Java中org.pushingpixels.flamingo.api.common.popup.JPopupPanel类的典型用法代码示例。如果您正苦于以下问题:Java JPopupPanel类的具体用法?Java JPopupPanel怎么用?Java JPopupPanel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JPopupPanel类属于org.pushingpixels.flamingo.api.common.popup包,在下文中一共展示了JPopupPanel类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getHomeEditBand
import org.pushingpixels.flamingo.api.common.popup.JPopupPanel; //导入依赖的package包/类
/**
* this method to Create The EditBand and return it to add in the Ribbon
*
* @return
*/
public JRibbonBand getHomeEditBand() {
JRibbonBand Edit = new JRibbonBand("Edit", null);
Button.EditText = new JCommandButton("Edit"
+ " Text", getResizableIconFromResource(new ImageIcon("/images/JPG48.png").toString()));
Button.EditText.setEnabled(false);
Button.EditObject = new JCommandButton("Edit"
+ " Object", getResizableIconFromResource(new ImageIcon("/images/GIF48.png").toString()));
Button.EditObject.setEnabled(false);
Button.EditObject.setCommandButtonKind(JCommandButton.CommandButtonKind.POPUP_ONLY);
Button.EditObject.setPopupCallback(new PopupPanelCallback() {
public JPopupPanel getPopupPanel(JCommandButton commandButton) {
JPopupPanel pan = new JPopupPanel() {
};
pan.setBackground(Color.WHITE);
return pan;
}
});
Edit.addCommandButton(Button.EditText, RibbonElementPriority.TOP);
Edit.addCommandButton(Button.EditObject, RibbonElementPriority.TOP);
List<RibbonBandResizePolicy> resizePolicies = new ArrayList<RibbonBandResizePolicy>();
resizePolicies.add(new CoreRibbonResizePolicies.Mirror(Edit.getControlPanel()));
Edit.setResizePolicies(resizePolicies);
return Edit;
}
示例2: createCommandButton
import org.pushingpixels.flamingo.api.common.popup.JPopupPanel; //导入依赖的package包/类
private AbstractCommandButton createCommandButton(ActionItem item) {
//TODO
//button.setDisabledIcon(disabledIcon);
ActionCommandButton button = new ActionCommandButton(item.getActionDelegate().getIcon(),
item.getActionDelegate().getText(), item.getActionDelegate().getAction(), getButtonKind(item));
RichTooltip toolTip = item.getActionDelegate().createTooltip();
button.setActionRichTooltip(toolTip);
if (item.hasChildren()) {
//TODO differentiate between the two
//button.setPopupRichTooltip(tooltip);
final JCommandPopupMenu menu = createPopupMenu(item.getChildren());
button.setPopupCallback(new PopupPanelCallback() {
@Override
public JPopupPanel getPopupPanel(JCommandButton commandButton) {
return menu;
}
});
}
return button;
}
示例3: createPopupMenuPresenter
import org.pushingpixels.flamingo.api.common.popup.JPopupPanel; //导入依赖的package包/类
public JCommandMenuButton createPopupMenuPresenter(ActionItem item) {
//TODO orientation of popup
ActionMenuButton button = new ActionMenuButton(item.getIcon(),
item.getText(), item.getAction(), getButtonKind(item));
RichTooltip toolTip = item.createTooltip();
button.setActionRichTooltip(toolTip);
if (item.hasChildren()) {
//TODO differentiate between the two
//button.setPopupRichTooltip(tooltip);
final JCommandPopupMenu menu = createPopupMenu(item.getChildren());
button.setPopupCallback(new PopupPanelCallback() {
@Override
public JPopupPanel getPopupPanel(JCommandButton commandButton) {
return menu;
}
});
}
return button;
}
示例4: addImageTask
import org.pushingpixels.flamingo.api.common.popup.JPopupPanel; //导入依赖的package包/类
private void addImageTask(final JRibbon ribbon) {
JRibbonBand imageBandOpen = new JRibbonBand("Open Image", null);
imageBandOpen.setResizePolicies(Arrays.<RibbonBandResizePolicy>asList(new CoreRibbonResizePolicies.None(imageBandOpen.getControlPanel())));
buttonopenFromOrbit.setActionRichTooltip(new RichTooltip("Open Image", "Open an image from image serve or local file system."));
buttonopenFromOrbit.addActionListener(oia == null ? null : oia.openFileOrbitActionListener);
imageBandOpen.addCommandButton(buttonopenFromOrbit, RibbonElementPriority.TOP);
JRibbonBand imageBandOpenSpecial = new JRibbonBand("Open Special", null);
imageBandOpenSpecial.setResizePolicies(Arrays.<RibbonBandResizePolicy>asList(new CoreRibbonResizePolicies.None(imageBandOpenSpecial.getControlPanel())));
JCommandButton buttonImg1 = new JCommandButton("View Overview (CTRL-O)", new SlidepreviewNoLoupe6());
buttonImg1.setActionRichTooltip(new RichTooltip("View Overview", "Load the whole-slide overview. Only available if the image stems from a whole slide scanner."));
buttonImg1.addActionListener(oia == null ? null : oia.loadOverviewActionListener);
imageBandOpenSpecial.addCommandButton(buttonImg1, RibbonElementPriority.TOP);
JCommandButton buttonImg2 = new JCommandButton("Open Spot Detection", new DocumentOpen5());
buttonImg2.setActionRichTooltip(new RichTooltip("Load Image for TMA Spot Detection", "Load a special resolution image on which the TMA spot detection can be performed."));
buttonImg2.addActionListener(oia == null ? null : oia.loadTMAThumbnailActionListener);
imageBandOpenSpecial.addCommandButton(buttonImg2, RibbonElementPriority.TOP);
JCommandButton buttonImg3 = new JCommandButton("Open Resolution for Printing", new DocumentOpen5());
buttonImg3.setActionRichTooltip(new RichTooltip("Load Printing Resolution", "Load a medium size resolution which is suitable for printing."));
buttonImg3.addActionListener(oia == null ? null : oia.loadMediumResolutionActionListener);
imageBandOpenSpecial.addCommandButton(buttonImg3, RibbonElementPriority.TOP);
JCommandButton buttonImgSpecialResolution = new JCommandButton("Open Special Resolution", new DocumentOpen5());
RichTooltip richTooltipSpecialResolution = new RichTooltip("Load Special Resolution", "Load a special resolution of the image.");
richTooltipSpecialResolution.addDescriptionSection("Each successor resolution has half the size in each dimension as the parent resolution.");
buttonImgSpecialResolution.setActionRichTooltip(richTooltipSpecialResolution);
imageBandOpenSpecial.addCommandButton(buttonImgSpecialResolution, RibbonElementPriority.TOP);
buttonImgSpecialResolution.setCommandButtonKind(JCommandButton.CommandButtonKind.POPUP_ONLY);
buttonImgSpecialResolution.setPopupCallback(new PopupPanelCallback() {
@Override
public JPopupPanel getPopupPanel(JCommandButton jCommandButton) {
return getSpecialResolutionPopupPanel();
}
});
// save as .orbit
JRibbonBand saveAsOrbitBand = new JRibbonBand("Save", null);
saveAsOrbitBand.setResizePolicies(Arrays.<RibbonBandResizePolicy>asList(new CoreRibbonResizePolicies.None(saveAsOrbitBand.getControlPanel())));
JCommandButton buttonSaveAsOrbit = new JCommandButton("Save image links as .orbit", new DocumentSaveAs3());
RichTooltip richTooltipSaveAsOrbit = new RichTooltip("Save image links as .orbit", "Saves all open images as links in a .orbit file.");
richTooltipSaveAsOrbit.addDescriptionSection("Can be used to save or email an interesting image set.");
buttonSaveAsOrbit.setActionRichTooltip(richTooltipSaveAsOrbit);
buttonSaveAsOrbit.addActionListener(oia == null ? null : oia.saveAsOrbitActionListener);
saveAsOrbitBand.addCommandButton(buttonSaveAsOrbit, RibbonElementPriority.TOP);
JRibbonBand switchImageProviderBand = getSwitchImageProviderBand();
RibbonTask imageTask = new RibbonTask("Image", imageBandOpen, imageBandOpenSpecial, saveAsOrbitBand, switchImageProviderBand);
ribbon.addTask(imageTask);
}
示例5: getSpecialResolutionPopupPanel
import org.pushingpixels.flamingo.api.common.popup.JPopupPanel; //导入依赖的package包/类
public JPopupPanel getSpecialResolutionPopupPanel() {
return null;
}
示例6: installListeners
import org.pushingpixels.flamingo.api.common.popup.JPopupPanel; //导入依赖的package包/类
@Override
protected void installListeners() {
super.installListeners();
this.commandButton.removeActionListener(this.disposePopupsActionListener);
this.disposePopupsActionListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (commandButton == null) { //Added by JPEXS
return;
}
boolean toDismiss = !Boolean.TRUE.equals(commandButton
.getClientProperty(DONT_DISPOSE_POPUPS));
if (toDismiss) {
JCommandPopupMenu menu = (JCommandPopupMenu) SwingUtilities
.getAncestorOfClass(JCommandPopupMenu.class,
commandButton);
if (menu != null) {
toDismiss = menu.isToDismissOnChildClick();
}
}
if (toDismiss) {
if (SwingUtilities.getAncestorOfClass(JPopupPanel.class,
commandButton) != null) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
// command button may be cleared if the
// button click resulted in LAF switch
if (commandButton != null) {
// clear the active states
commandButton.getActionModel().setPressed(
false);
commandButton.getActionModel().setRollover(
false);
commandButton.getActionModel().setArmed(
false);
}
}
});
}
PopupPanelManager.defaultManager().hidePopups(null);
}
}
};
this.commandButton.addActionListener(disposePopupsActionListener);
}
示例7: BoundCommandButton
import org.pushingpixels.flamingo.api.common.popup.JPopupPanel; //导入依赖的package包/类
public BoundCommandButton(CommandButtonKind kind, String text, String description, ResizableIcon icon,
ResizableIcon disabledIcon, Action mainAction, Action... extraActions) {
super(text, icon);
this.mainAction = mainAction;
this.extraActions = extraActions;
setCommandButtonKind(kind);
setDisabledIcon(disabledIcon);
addActionListener(mainAction);
RichTooltip tooltip = new RichTooltip();
tooltip.setTitle(getText());
tooltip.addDescriptionSection(description == null || description.length() == 0 ? " " : description);
setActionRichTooltip(tooltip);
setPopupRichTooltip(tooltip);
PropertyChangeListener l = new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if ("enabled".equals(evt.getPropertyName())) {
updateState();
}
}
};
mainAction.addPropertyChangeListener(l);
if (extraActions.length > 0) {
final JCommandPopupMenu menu = new JCommandPopupMenu();
for (Action extraAction : extraActions) {
menu.addMenuButton(new BoundMenuCommandButton(extraAction));
if (extraAction != mainAction) {
extraAction.addPropertyChangeListener(l);
}
}
setPopupCallback(new PopupPanelCallback() {
@Override
public JPopupPanel getPopupPanel(JCommandButton commandButton) {
return menu;
}
});
}
updateState();
}
示例8: getPopupPanel
import org.pushingpixels.flamingo.api.common.popup.JPopupPanel; //导入依赖的package包/类
@Override
public JPopupPanel getPopupPanel(JCommandButton commandButton) {
return menu;
}