本文整理汇总了Java中org.pushingpixels.flamingo.api.common.JCommandButton类的典型用法代码示例。如果您正苦于以下问题:Java JCommandButton类的具体用法?Java JCommandButton怎么用?Java JCommandButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JCommandButton类属于org.pushingpixels.flamingo.api.common包,在下文中一共展示了JCommandButton类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createResetModelBand
import org.pushingpixels.flamingo.api.common.JCommandButton; //导入依赖的package包/类
private JRibbonBand createResetModelBand(boolean withSegmentation) {
JRibbonBand modelResetBand = new JRibbonBand("Reset", null);
JCommandButton buttonResetMainModel = new JCommandButton("Main Model", new EditClear3());
RichTooltip richTooltipResetMainModel = new RichTooltip("Reset Main Model", "Reset the main model. Nested models like the segmentation model or exclusion model will still be valid and available.");
richTooltipResetMainModel.addDescriptionSection("After a segmentation this can be used to train a cell classification model (then the nested segmentaiton model will still be active).");
buttonResetMainModel.setActionRichTooltip(richTooltipResetMainModel);
buttonResetMainModel.addActionListener(oia == null ? null : oia.resetMainModelActionListener);
modelResetBand.addCommandButton(buttonResetMainModel, RibbonElementPriority.MEDIUM);
if (withSegmentation) {
modelResetBand.addCommandButton(createDeleteSegmentationModelButton(), RibbonElementPriority.MEDIUM);
modelResetBand.addCommandButton(createDeleteSecondarySegmentationModelButton(), RibbonElementPriority.MEDIUM);
}
JCommandButton buttonResetEntireModel = new JCommandButton("Entire Model", new EditDelete3());
RichTooltip richTooltipResetEntireModel = new RichTooltip("Reset Entire Model", "Reset the entire model. The complete model will be removed. Afterwards, you can start from scratch with a new model.");
buttonResetEntireModel.setActionRichTooltip(richTooltipResetEntireModel);
buttonResetEntireModel.addActionListener(oia == null ? null : oia.resetEntireModelActionListener);
modelResetBand.addCommandButton(buttonResetEntireModel, RibbonElementPriority.MEDIUM);
modelResetBand.setResizePolicies(Arrays.<RibbonBandResizePolicy>asList(new CoreRibbonResizePolicies.None(modelResetBand.getControlPanel()),
new CoreRibbonResizePolicies.Mirror(modelResetBand.getControlPanel()),
new IconRibbonBandResizePolicy(modelResetBand.getControlPanel())));
return modelResetBand;
}
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:27,代码来源:OrbitMenu.java
示例2: addDrawButtons
import org.pushingpixels.flamingo.api.common.JCommandButton; //导入依赖的package包/类
private void addDrawButtons(final JRibbonBand band, boolean ownBand) {
JCommandButton buttonEraser = new JCommandButton("Eraser", new LmproulxEraser());
buttonEraser.setActionRichTooltip(new RichTooltip("Eraser", "Click into a shape on an image to erase it."));
buttonEraser.addActionListener(oia == null ? null : oia.deleteActionListener);
band.addCommandButton(buttonEraser, RibbonElementPriority.TOP);
JCommandButton buttonDrawPolygon = new JCommandButton("Polygon", new DrawPoly());
makeMandatory(buttonDrawPolygon);
buttonDrawPolygon.setActionRichTooltip(new RichTooltip("Polygon", "Draw a polygon. When you release the mouse button, the polygon will be closed."));
buttonDrawPolygon.addActionListener(oia == null ? null : oia.brushActionListener);
band.addCommandButton(buttonDrawPolygon, RibbonElementPriority.TOP);
JCommandButton buttonDrawCircle = new JCommandButton("Circle", new DrawCircle());
buttonDrawCircle.setActionRichTooltip(new RichTooltip("Circle", "Draw a circle. Use the mouse-wheel to adjust the size."));
buttonDrawCircle.addActionListener(oia == null ? null : oia.circleActionListener);
band.addCommandButton(buttonDrawCircle, ownBand ? RibbonElementPriority.MEDIUM : RibbonElementPriority.TOP);
JCommandButton buttonDrawRectangle = new JCommandButton("Rectangle", new DrawRectangle());
buttonDrawRectangle.setActionRichTooltip(new RichTooltip("Rectangle", "Draw a rectangle."));
buttonDrawRectangle.addActionListener(oia == null ? null : oia.rectangleActionListener);
band.addCommandButton(buttonDrawRectangle, ownBand ? RibbonElementPriority.MEDIUM : RibbonElementPriority.TOP);
}
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:23,代码来源:OrbitMenu.java
示例3: addTrainClassifyButtons
import org.pushingpixels.flamingo.api.common.JCommandButton; //导入依赖的package包/类
private void addTrainClassifyButtons(final JRibbonBand band) {
JCommandButton buttonTrain = new JCommandButton("Train (F7)", new Training());
makeMandatory(buttonTrain);
RichTooltip richTooltipTrain = new RichTooltip("Train Model", "Train a model based on the class shapes drawn in the images.");
richTooltipTrain.addDescriptionSection("The class shapes from all open images are taken into account.");
buttonTrain.setActionRichTooltip(richTooltipTrain);
buttonTrain.addActionListener(oia == null ? null : oia.trainActionListener);
band.addCommandButton(buttonTrain, RibbonElementPriority.TOP);
band.addCommandButton(createDefineROIButton(), RibbonElementPriority.TOP);
JCommandButton buttonClassify = new JCommandButton("Classify (F8)", new ApplicationsGraphics2());
makeMandatory(buttonClassify);
RichTooltip richTooltipClassify = new RichTooltip("Classify Image", "Classify the active image based on a trained model.");
richTooltipClassify.addDescriptionSection("If no ROI is active, the whole image will be classified, otherwise only the region inside the ROI.");
richTooltipClassify.addDescriptionSection("A ROI can be defined with the ROI tool, annotations or an exclusion model.");
richTooltipClassify.addDescriptionSection("Use the Batch menu to classify a set of images in batch mode.");
buttonClassify.setActionRichTooltip(richTooltipClassify);
buttonClassify.addActionListener(oia == null ? null : oia.classifyActionListener);
buttonClassify.setBackground(Color.magenta);
band.addCommandButton(buttonClassify, RibbonElementPriority.TOP);
}
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:23,代码来源:OrbitMenu.java
示例4: SpecialResMenu
import org.pushingpixels.flamingo.api.common.JCommandButton; //导入依赖的package包/类
public SpecialResMenu() {
if (specialResImagesAvailable) {
ImageFrame iFrame = getIFrame();
if (iFrame != null) {
int numImg = iFrame.recognitionFrame.bimg.getMipMaps() == null ? 0 : iFrame.recognitionFrame.bimg.getMipMaps().length;
if (numImg > 0) {
for (int i = 0; i < numImg; i++) {
final int mipNum = i + 1;
JCommandButton btn = new JCommandButton("Open layer " + mipNum + " [" + iFrame.recognitionFrame.bimg.getMipMaps()[numImg - i - 1].getWidth() + " x " + iFrame.recognitionFrame.bimg.getMipMaps()[numImg - i - 1].getHeight() + "]");
btn.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
loadLowResImage(mipNum);
}
});
add(btn);
}
}
}
} else {
add(new JLabel("No layers available"));
}
}
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:26,代码来源:OrbitImageAnalysis.java
示例5: getHomeEditBand
import org.pushingpixels.flamingo.api.common.JCommandButton; //导入依赖的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;
}
开发者ID:DJVUpp,项目名称:Desktop,代码行数:30,代码来源:DjvuComponents.java
示例6: getUiOptionsBand
import org.pushingpixels.flamingo.api.common.JCommandButton; //导入依赖的package包/类
/**
* this method to Create The UIOptionBand and return it to add in the Ribbon
*
* @param Djvu
* @return
*/
public JRibbonBand getUiOptionsBand(DjvuStart Djvu) {
JRibbonBand Uioptions = new JRibbonBand("UI Options", null);
Uioptions.setResizePolicies(CoreRibbonResizePolicies.getCorePoliciesRestrictive(Uioptions));
Uioptions.startGroup();
Button.Switch = new JCommandButton("Change "
+ "ToolBar Mode", null);
Uioptions.addCommandButton(Button.Switch, RibbonElementPriority.TOP);
Uioptions.startGroup();
System.err.println(DjvuStart.djvu);
JRibbonComponent look_feel = new JRibbonComponent(null, "Change "
+ "Djvu++ Skin", LookAndFeelSwitcher.getLookAndFeelSwitcher(Djvu));
look_feel.setDisplayPriority(RibbonElementPriority.TOP);
Uioptions.addRibbonComponent(look_feel);
List<RibbonBandResizePolicy> resizePolicies = new ArrayList<RibbonBandResizePolicy>();
resizePolicies.add(new CoreRibbonResizePolicies.Mirror(Uioptions.getControlPanel()));
Uioptions.setResizePolicies(resizePolicies);
return Uioptions;
}
开发者ID:DJVUpp,项目名称:Desktop,代码行数:26,代码来源:DjvuComponents.java
示例7: getTypewriterBand
import org.pushingpixels.flamingo.api.common.JCommandButton; //导入依赖的package包/类
/**
*
* @return
*/
public JRibbonBand getTypewriterBand() {
JRibbonBand Typewriter = new JRibbonBand("TypeWriter", null);
Typewriter.setResizePolicies(CoreRibbonResizePolicies.getCorePoliciesRestrictive(Typewriter));
Typewriter.startGroup();
Button.Note2 = new JCommandButton("Note", getResizableIconFromResource("/images/notes48.png"));
Button.Note2.setEnabled(false);
Typewriter.addCommandButton(Button.Note2, RibbonElementPriority.TOP);
Typewriter.startGroup();
Button.TWriter = new JCommandButton("TyperWriter", getResizableIconFromResource("/images/type writer48.png"));
Button.TWriter.setEnabled(false);
Button.TextBox = new JCommandButton("TextBox", getResizableIconFromResource("/images/callout48.png"));
Button.TextBox.setEnabled(false);
Button.Callout = new JCommandButton("Callout", getResizableIconFromResource("/images/textbox48.png"));
Button.Callout.setEnabled(false);
Typewriter.addCommandButton(Button.TWriter, RibbonElementPriority.TOP);
Typewriter.addCommandButton(Button.Callout, RibbonElementPriority.MEDIUM);
Typewriter.addCommandButton(Button.TextBox, RibbonElementPriority.MEDIUM);
List<RibbonBandResizePolicy> resizePolicies = new ArrayList<RibbonBandResizePolicy>();
resizePolicies.add(new CoreRibbonResizePolicies.Mirror(Typewriter.getControlPanel()));
Typewriter.setResizePolicies(resizePolicies);
return Typewriter;
}
开发者ID:DJVUpp,项目名称:Desktop,代码行数:28,代码来源:DjvuComponents.java
示例8: createCommandButton
import org.pushingpixels.flamingo.api.common.JCommandButton; //导入依赖的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;
}
开发者ID:Alidron,项目名称:designer,代码行数:22,代码来源:RibbonComponentFactory.java
示例9: createPopupMenuPresenter
import org.pushingpixels.flamingo.api.common.JCommandButton; //导入依赖的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;
}
开发者ID:Alidron,项目名称:designer,代码行数:21,代码来源:RibbonComponentFactory.java
示例10: paintIcon
import org.pushingpixels.flamingo.api.common.JCommandButton; //导入依赖的package包/类
@Override
public void paintIcon(Component c, Graphics g, int x, int y) {
Graphics2D g2d = (Graphics2D) g;
if (orientationKind == JCommandButton.CommandButtonPopupOrientationKind.DOWNWARD) {
g2d.setPaint(new LinearGradientPaint(0, 0, 0, ICON_HEIGHT-1, new float[] {0, 1}, new Color[] {
C1, C2
}));
g.drawLine(x, y, x+6, y);
g.drawLine(x+1, y+1, x+5, y+1);
g.drawLine(x+2, y+2, x+4, y+2);
g.drawLine(x+3, y+3, x+3, y+3);
} else {
g2d.setPaint(new LinearGradientPaint(0, 0, ICON_WIDTH-1, 0, new float[] {0, 1}, new Color[] {
C1, C2
}));
g.drawLine(x, y, x, y+6);
g.drawLine(x+1, y+1, x+1, y+5);
g.drawLine(x+2, y+2, x+2, y+4);
g.drawLine(x+3, y+3, x+3, y+3);
}
}
开发者ID:Depter,项目名称:JRLib,代码行数:22,代码来源:OfficeCommandMenuButtonUI.java
示例11: initComponents
import org.pushingpixels.flamingo.api.common.JCommandButton; //导入依赖的package包/类
private void initComponents() {
startGroup();
addRibbonComponent(new JRibbonComponent(new MonthPanel()), 2);
startGroup();
// addRibbonComponent(createButton("Exclude", "exclude.png"));
// addRibbonComponent(createButton("Corrigate", "correction.png"));
// addRibbonComponent(createButton("Smooth", "cell_smoothing.png"));
//
// JCommandButtonStrip strip = new JCommandButtonStrip(JCommandButtonStrip.StripOrientation.VERTICAL);
// strip.add(new JCommandButton("Exclude", getResizableIcon("exclude.png")));
// strip.add(new JCommandButton("Corrigate", getResizableIcon("correction.png")));
// strip.add(new JCommandButton("Smooth", getResizableIcon("cell_smoothing.png")));
// addRibbonComponent(new JRibbonComponent(strip), 3);
RibbonElementPriority bp = RibbonElementPriority.TOP;
addCommandButton(new JCommandButton("Exclude", getResizableIcon("exclude.png")), bp);
addCommandButton(new JCommandButton("Corrigate", getResizableIcon("correction.png")), bp);
addCommandButton(new JCommandButton("Smooth", getResizableIcon("cell_smoothing.png")), bp);
// addFlowComponent(new JRibbonComponent(new MonthPanel()));
// addFlowComponent(new JCommandButton("Exclude", getIcon("exclude.png")));
// addFlowComponent(new JCommandButton("Corrigate", getIcon("correction.png")));
// addFlowComponent(new JCommandButton("Smooth", getIcon("cell_smoothing.png")));
//
// JCommandButtonStrip strip = new JCommandButtonStrip(JCommandButtonStrip.StripOrientation.VERTICAL);
// strip.add(new JCommandButton("Exclude", getIcon("exclude.png")));
// strip.add(new JCommandButton("Corrigate", getIcon("correction.png")));
// strip.add(new JCommandButton("Smooth", getIcon("cell_smoothing.png")));
// addFlowComponent(strip);
//
// JCommandButtonPanel panel = new JCommandButtonPanel(CommandButtonDisplayState.TILE);
// panel.setLayoutKind(JCommandButtonPanel.LayoutKind.ROW_FILL);
// panel.add(new JCommandButton("Exclude", getIcon("exclude.png")));
// panel.add(new JCommandButton("Corrigate", getIcon("correction.png")));
// panel.add(new JCommandButton("Smooth", getIcon("cell_smoothing.png")));
// addFlowComponent(panel);
}
开发者ID:Depter,项目名称:JRLib,代码行数:38,代码来源:ClaimTrianglePane.java
示例12: addEditTask
import org.pushingpixels.flamingo.api.common.JCommandButton; //导入依赖的package包/类
private void addEditTask(final JRibbon ribbon) {
JRibbonBand copyBand = new JRibbonBand("Copy", null);
copyBand.setResizePolicies(Arrays.<RibbonBandResizePolicy>asList(new CoreRibbonResizePolicies.None(copyBand.getControlPanel()),
new CoreRibbonResizePolicies.Mirror(copyBand.getControlPanel()),
new CoreRibbonResizePolicies.Mid2Low(copyBand.getControlPanel()),
new IconRibbonBandResizePolicy(copyBand.getControlPanel())));
JCommandButton buttonCopyImageCurrentView = new JCommandButton("Copy Image (Current View)", new EditCopy4());
buttonCopyImageCurrentView.setActionRichTooltip(new RichTooltip("Copy Image (Current View)", "Copies the current view exactly as you see it in the image frame into the clipboard."));
buttonCopyImageCurrentView.addActionListener(oia == null ? null : oia.copyImageCurrentViewActionHandler);
copyBand.addCommandButton(buttonCopyImageCurrentView, RibbonElementPriority.TOP);
JCommandButton buttonCopyOrbitLink = new JCommandButton("Copy Orbit Link", new EditCopy4());
buttonCopyOrbitLink.setActionRichTooltip(new RichTooltip("Copy Orbit Link", "Copies a file with an Orbit link into the clipboard."));
buttonCopyOrbitLink.addActionListener(oia == null ? null : oia.copyOrbitListActionHandler);
copyBand.addCommandButton(buttonCopyOrbitLink, RibbonElementPriority.MEDIUM);
JCommandButton buttonCopyImageFull = new JCommandButton("Copy Image (Full)", new EditCopy4());
RichTooltip toolTip = new RichTooltip("Copy Image (Full)", "Copies the original full-size image (without markup) into the clipboard.");
toolTip.addDescriptionSection("This only works for small images. For large images, please use Copy Image (Current View) instead.");
buttonCopyImageFull.setActionRichTooltip(toolTip);
buttonCopyImageFull.addActionListener(oia == null ? null : oia.copyImageFullActionHandler);
copyBand.addCommandButton(buttonCopyImageFull, RibbonElementPriority.MEDIUM);
JRibbonBand pasteBand = new JRibbonBand("Paste", null);
JCommandButton buttonPaste = new JCommandButton("Paste", new EditPaste4());
buttonPaste.setActionRichTooltip(new RichTooltip("Paste", "Inserts an image from the clipboard."));
buttonPaste.addActionListener(oia == null ? null : oia.pasteActionHandler);
pasteBand.addCommandButton(buttonPaste, RibbonElementPriority.TOP);
pasteBand.setResizePolicies(Arrays.<RibbonBandResizePolicy>asList(new CoreRibbonResizePolicies.None(pasteBand.getControlPanel())));
RibbonTask editTask = new RibbonTask("Edit", copyBand, pasteBand);
ribbon.addTask(editTask);
}
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:39,代码来源:OrbitMenu.java
示例13: addExclusionParameterButton
import org.pushingpixels.flamingo.api.common.JCommandButton; //导入依赖的package包/类
private void addExclusionParameterButton(JRibbonBand modelConfigureBand, RibbonElementPriority priority) {
JCommandButton buttonConfigureExclusionParameters = new JCommandButton("Exclusion Model Level", new Configure4());
RichTooltip richTooltipExclusion = new RichTooltip("Configure Exclusion Model Level", "Set the detail level used for the exclusion model.");
richTooltipExclusion.addDescriptionSection("Set to 1 for a standard exclusion model. Set it to 2 for a more fine grained exclusion model. This can help to detect more details in the exclusion model, but has the drawback to be a more specific and less general exclusion model");
richTooltipExclusion.addDescriptionSection("The fine grained model (2) is also much slower than the standard model (1).");
buttonConfigureExclusionParameters.setActionRichTooltip(richTooltipExclusion);
buttonConfigureExclusionParameters.addActionListener(oia == null ? null : oia.configureExclusionParametersActionListener);
modelConfigureBand.addCommandButton(buttonConfigureExclusionParameters, priority);
}
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:10,代码来源:OrbitMenu.java
示例14: createDeleteSecondarySegmentationModelButton
import org.pushingpixels.flamingo.api.common.JCommandButton; //导入依赖的package包/类
private JCommandButton createDeleteSecondarySegmentationModelButton() {
JCommandButton buttonResetSecondarySegmentationModel = new JCommandButton("Secondary Segmentation Model", new ClearSecSegModel());
RichTooltip richTooltipResetSecondarySegmentationModel = new RichTooltip("Reset Secondary Segmentation Model", "Reset the secondary segmentation model.");
richTooltipResetSecondarySegmentationModel.addDescriptionSection("The primary segmentation model will still be available. A new secondary segmentation model can be defined and set.");
buttonResetSecondarySegmentationModel.setActionRichTooltip(richTooltipResetSecondarySegmentationModel);
buttonResetSecondarySegmentationModel.addActionListener(oia == null ? null : oia.resetSecondarySegmentationModelActionListener);
return buttonResetSecondarySegmentationModel;
}
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:9,代码来源:OrbitMenu.java
示例15: createDeleteSegmentationModelButton
import org.pushingpixels.flamingo.api.common.JCommandButton; //导入依赖的package包/类
private JCommandButton createDeleteSegmentationModelButton() {
JCommandButton buttonResetSegmentationModel = new JCommandButton("Primary Segmentation Model", new EditDelete6());
RichTooltip richTooltipResetSegmentationModel = new RichTooltip("Reset Segmentation Model", "Reset the segmentation model.");
richTooltipResetSegmentationModel.addDescriptionSection("Remove the segmentation model. The main model will still be available.");
richTooltipResetSegmentationModel.addDescriptionSection("An existing secondary segmentation model will not be removed.");
buttonResetSegmentationModel.setActionRichTooltip(richTooltipResetSegmentationModel);
buttonResetSegmentationModel.addActionListener(oia == null ? null : oia.resetSegmentationModelActionListener);
return buttonResetSegmentationModel;
}
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:10,代码来源:OrbitMenu.java
示例16: createDefineROIButton
import org.pushingpixels.flamingo.api.common.JCommandButton; //导入依赖的package包/类
private JCommandButton createDefineROIButton() {
JCommandButton buttonDefineRoi = new JCommandButton("Define ROI", new DrawRoi2());
RichTooltip richTooltipDefineRoi = new RichTooltip("Define Region of Interest", "Draw a polygon to define the ROI for operations like classification or segmentation.");
richTooltipDefineRoi.addDescriptionSection("Defines only a temporary ROI. For a permanent ROI please use annotations, which are stored in the database.");
richTooltipDefineRoi.addDescriptionSection("Use the ROI menu for more options, e.g. invert or reset the ROI.");
buttonDefineRoi.setActionRichTooltip(richTooltipDefineRoi);
buttonDefineRoi.addActionListener(oia == null ? null : oia.selectROIActionListener);
return buttonDefineRoi;
}
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:10,代码来源:OrbitMenu.java
示例17: getSwitchImageProviderBand
import org.pushingpixels.flamingo.api.common.JCommandButton; //导入依赖的package包/类
private JRibbonBand getSwitchImageProviderBand() {
JRibbonBand switchImageProviderBand = new JRibbonBand("Image Provider", null);
switchImageProviderBand.setResizePolicies(Arrays.<RibbonBandResizePolicy>asList(new CoreRibbonResizePolicies.None(switchImageProviderBand.getControlPanel()),
new CoreRibbonResizePolicies.Mirror(switchImageProviderBand.getControlPanel()),
new CoreRibbonResizePolicies.Mid2Low(switchImageProviderBand.getControlPanel()),
new IconRibbonBandResizePolicy(switchImageProviderBand.getControlPanel())));
JCommandButton buttonSwitchLocalRemote = getSwitchImageProviderBtn();
switchImageProviderBand.addCommandButton(buttonSwitchLocalRemote, RibbonElementPriority.TOP);
return switchImageProviderBand;
}
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:12,代码来源:OrbitMenu.java
示例18: addCustomTask
import org.pushingpixels.flamingo.api.common.JCommandButton; //导入依赖的package包/类
private void addCustomTask(final JRibbon ribbon) {
ICustomMenu customMenu = DALConfig.getCustomMenu();
if (customMenu != null) {
JRibbonBand customBand = new JRibbonBand("Custom", null);
customBand.setResizePolicies(Arrays.<RibbonBandResizePolicy>asList(new CoreRibbonResizePolicies.None(customBand.getControlPanel()),
new IconRibbonBandResizePolicy(customBand.getControlPanel())));
for (JCommandButton button : customMenu.getTaskList()) {
customBand.addCommandButton(button, RibbonElementPriority.TOP);
}
RibbonTask customTask = new RibbonTask("Custom", customBand);
ribbon.addTask(customTask);
}
}
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:14,代码来源:OrbitMenu.java
示例19: loadRecent
import org.pushingpixels.flamingo.api.common.JCommandButton; //导入依赖的package包/类
@Override
protected void loadRecent(ActionEvent evt) {
if (evt.getSource() instanceof JPanel) {
JPanel targetPanel = (JPanel) evt.getSource();
targetPanel.removeAll();
JCommandButtonPanel openHistoryPanel = new JCommandButtonPanel(CommandButtonDisplayState.MEDIUM);
String groupName = translate("menu.recentFiles");
openHistoryPanel.addButtonGroup(groupName);
List<String> recentFiles = Configuration.getRecentFiles();
int j = 0;
for (int i = recentFiles.size() - 1; i >= 0; i--) {
String path = recentFiles.get(i);
RecentFilesButton historyButton = new RecentFilesButton(j + " " + path, null);
historyButton.fileName = path;
historyButton.addActionListener((ActionEvent ae) -> {
RecentFilesButton source = (RecentFilesButton) ae.getSource();
if (Main.openFile(source.fileName, null) == OpenFileResult.NOT_FOUND) {
if (View.showConfirmDialog(null, translate("message.confirm.recentFileNotFound"), translate("message.confirm"), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_NO_OPTION) {
Configuration.removeRecentFile(source.fileName);
}
}
});
j++;
historyButton.setHorizontalAlignment(SwingUtilities.LEFT);
openHistoryPanel.addButtonToLastGroup(historyButton);
}
if (recentFiles.isEmpty()) {
JCommandButton emptyLabel = new JCommandButton(translate("menu.recentFiles.empty"));
emptyLabel.setHorizontalAlignment(SwingUtilities.LEFT);
emptyLabel.setEnabled(false);
openHistoryPanel.addButtonToLastGroup(emptyLabel);
}
openHistoryPanel.setMaxButtonColumns(1);
targetPanel.setLayout(new BorderLayout());
targetPanel.add(openHistoryPanel, BorderLayout.CENTER);
}
}
开发者ID:jindrapetrik,项目名称:jpexs-decompiler,代码行数:40,代码来源:MainFrameRibbonMenu.java
示例20: paintPopupActionIcon
import org.pushingpixels.flamingo.api.common.JCommandButton; //导入依赖的package包/类
@Override
protected void paintPopupActionIcon(Graphics g, Rectangle rect) {
boolean popupEnabled = commandButton instanceof JCommandButton
&& ((JCommandButton) commandButton).getPopupModel().isEnabled();
Graphics2D g2d = (Graphics2D) g.create();
if (!popupEnabled) {
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.5f));
}
popupActionIcon.paintIcon(commandButton, g2d, rect.x, rect.y);
g2d.dispose();
}
开发者ID:Depter,项目名称:JRLib,代码行数:12,代码来源:OfficeCommandButtonUI.java
注:本文中的org.pushingpixels.flamingo.api.common.JCommandButton类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论