• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java JXStatusBar类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jdesktop.swingx.JXStatusBar的典型用法代码示例。如果您正苦于以下问题:Java JXStatusBar类的具体用法?Java JXStatusBar怎么用?Java JXStatusBar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



JXStatusBar类属于org.jdesktop.swingx包,在下文中一共展示了JXStatusBar类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: paintBackground

import org.jdesktop.swingx.JXStatusBar; //导入依赖的package包/类
@Override protected void paintBackground(Graphics2D g, JXStatusBar statusBar) {
    if (leftImage == null || middleImage == null || rightImage == null) {
        log.severe("Failed to initialize necessary assets. Set logging to FINE to see more details.");
        return;
    }
    //if bidi, reverse the image painting order
    //TODO need to handle vertical stretching better
    g.drawImage(leftImage, 0, 0, leftImage.getWidth(), statusBar.getHeight(), null);
    
    if (statusBar.isResizeHandleEnabled()) {
        g.drawImage(middleImage, leftImage.getWidth(), 0, statusBar.getWidth() - leftImage.getWidth() - rightImage.getWidth(), statusBar.getHeight(), null);
        g.drawImage(rightImage, statusBar.getWidth() - rightImage.getWidth(), 0, rightImage.getWidth(), statusBar.getHeight(), null);
    } else {
        g.drawImage(middleImage, leftImage.getWidth(), 0, statusBar.getWidth() - leftImage.getWidth(), statusBar.getHeight(), null);
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:17,代码来源:WindowsStatusBarUI.java


示例2: paintBackground

import org.jdesktop.swingx.JXStatusBar; //导入依赖的package包/类
@Override protected void paintBackground(Graphics2D g, JXStatusBar bar) {        
    g.setColor(bar.getBackground());
    g.fillRect(0, 0, bar.getWidth(), bar.getHeight());
    
    //paint an inset border around each component. This suggests that
    //there is an extra border around the status bar...!
    Border b = BorderFactory.createBevelBorder(BevelBorder.LOWERED, 
            Color.WHITE, bar.getBackground(), bar.getBackground(), Color.GRAY);
    Insets insets = new Insets(0, 0, 0, 0);
    for (Component c : bar.getComponents()) {
        getSeparatorInsets(insets);
        int x = c.getX() - insets.right;
        int y = c.getY() - 2;
        int w = c.getWidth() + insets.left + insets.right;
        int h = c.getHeight() + 4;
        b.paintBorder(c, g, x, y, w, h);
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:19,代码来源:WindowsClassicStatusBarUI.java


示例3: addWindowsDefaults

import org.jdesktop.swingx.JXStatusBar; //导入依赖的package包/类
@Override
protected void addWindowsDefaults(LookAndFeelAddons addon, DefaultsList defaults) {
    super.addWindowsDefaults(addon, defaults);
    if (OS.isUsingWindowsVisualStyles()) {
        defaults.add(JXStatusBar.uiClassID,
                "org.jdesktop.swingx.plaf.windows.WindowsStatusBarUI");
        
        String xpStyle = OS.getWindowsVisualStyle();
        
        if (WindowsLookAndFeelAddons.SILVER_VISUAL_STYLE.equalsIgnoreCase(xpStyle)
                || WindowsLookAndFeelAddons.VISTA_VISUAL_STYLE.equalsIgnoreCase(xpStyle)) {
            defaults.add("StatusBar.leftImage", "resources/silver-statusbar-left.png");
            defaults.add("StatusBar.middleImage", "resources/silver-statusbar-middle.png");
            defaults.add("StatusBar.rightImage", "resources/silver-statusbar-right.png");
        } else {
            defaults.add("StatusBar.leftImage", "resources/statusbar-left.png");
            defaults.add("StatusBar.middleImage", "resources/statusbar-middle.png");
            defaults.add("StatusBar.rightImage", "resources/statusbar-right.png");
        }
    } else {
        defaults.add(JXStatusBar.uiClassID,
                "org.jdesktop.swingx.plaf.windows.WindowsClassicStatusBarUI");
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:25,代码来源:StatusBarAddon.java


示例4: addWindowsDefaults

import org.jdesktop.swingx.JXStatusBar; //导入依赖的package包/类
protected void addWindowsDefaults(LookAndFeelAddons addon, DefaultsList defaults) {
    super.addWindowsDefaults(addon, defaults);
    if (OS.isUsingWindowsVisualStyles()) {
        defaults.add(JXStatusBar.uiClassID,
                "org.jdesktop.swingx.plaf.windows.WindowsStatusBarUI");
        
        String xpStyle = OS.getWindowsVisualStyle();
        
        if (WindowsLookAndFeelAddons.SILVER_VISUAL_STYLE.equalsIgnoreCase(xpStyle)) {
            defaults.add("StatusBar.leftImage", "resources/silver-statusbar-left.png");
            defaults.add("StatusBar.middleImage", "resources/silver-statusbar-middle.png");
            defaults.add("StatusBar.rightImage", "resources/silver-statusbar-right.png");
        } else {
            defaults.add("StatusBar.leftImage", "resources/statusbar-left.png");
            defaults.add("StatusBar.middleImage", "resources/statusbar-middle.png");
            defaults.add("StatusBar.rightImage", "resources/statusbar-right.png");
        }
    } else {
        defaults.add(JXStatusBar.uiClassID,
                "org.jdesktop.swingx.plaf.windows.WindowsClassicStatusBarUI");
    }
}
 
开发者ID:sing-group,项目名称:aibench-project,代码行数:23,代码来源:StatusBarAddon.java


示例5: init

import org.jdesktop.swingx.JXStatusBar; //导入依赖的package包/类
private void init() {
	final BorderLayout layout = new BorderLayout();
	final Container contentPane = getContentPane();
	contentPane.setLayout(layout);
	
	// window has 3 main elements: toolbar, dock area, status bar
	// each element is retrieved using the view model
	final EditorViewModel viewModel = getViewModel();
	
	// toolbar
	final SessionEditorToolbar tb = getToolbar();
	add(tb, BorderLayout.NORTH);
	
	// status bar
	final JXStatusBar sb = (JXStatusBar) getStatusBar();
	add(sb, BorderLayout.SOUTH);
	
	// setup content/dock area
	final Container dock = viewModel.getRoot();
	contentPane.add(dock, BorderLayout.CENTER);
	
	setupEditorActions();
}
 
开发者ID:phon-ca,项目名称:phon,代码行数:24,代码来源:SessionEditor.java


示例6: paintBackground

import org.jdesktop.swingx.JXStatusBar; //导入依赖的package包/类
@Override
protected void paintBackground(Graphics2D g, JXStatusBar bar) {
    int w = bar.getWidth(); //TODO deal with insets
    int h = bar.getHeight(); //TODO deal with insets
    
    //This list is comprised of floats and Colors, which together
    //constitute the gradient.
    List<?> gradient = (List<?>) UIManager.get("MenuBar.gradient");

    if (gradient != null && w > 0 && 0 < h) {
        float ratio1 = ((Number)gradient.get(0)).floatValue();
        float ratio2 = ((Number)gradient.get(1)).floatValue();
        Color c1 = (Color)gradient.get(2);
        Color c2 = (Color)gradient.get(3);
        Color c3 = (Color)gradient.get(4);
        int mid = (int)(ratio1 * h);
        int mid2 = (int)(ratio2 * h);
        if (mid > 0) {
            g.setPaint(new GradientPaint((float)0, (float)0, c1, (float)0,
                                   (float)mid, c2));
            g.fillRect(0, 0, w, mid);
        }
        if (mid2 > 0) {
            g.setColor(c2);
            g.fillRect(0, mid, w, mid2);
        }
        if (mid > 0) {
            g.setPaint(new GradientPaint((float)0, (float)mid + mid2, c2,
                                   (float)0, (float)mid * 2 + mid2, c1));
            g.fillRect(0, mid + mid2, w, mid);
        }
        if (h - mid * 2 - mid2 > 0) {
            g.setPaint(new GradientPaint((float)0, (float)mid * 2 + mid2, c1,
                                   (float)0, (float)h, c3));
            g.fillRect(0, mid * 2 + mid2, w, h - mid * 2 - mid2);
        }
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:39,代码来源:MetalStatusBarUI.java


示例7: installDefaults

import org.jdesktop.swingx.JXStatusBar; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void installDefaults(JXStatusBar sb) {
    super.installDefaults(sb);
    
    LookAndFeel.installProperty(statusBar, "opaque", Boolean.FALSE);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:10,代码来源:MacOSXStatusBarUI.java


示例8: addBasicDefaults

import org.jdesktop.swingx.JXStatusBar; //导入依赖的package包/类
@Override
protected void addBasicDefaults(LookAndFeelAddons addon, DefaultsList defaults) {
    super.addBasicDefaults(addon, defaults);
    
    defaults.add(JXStatusBar.uiClassID,
            "org.jdesktop.swingx.plaf.basic.BasicStatusBarUI");
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:8,代码来源:StatusBarAddon.java


示例9: addMacDefaults

import org.jdesktop.swingx.JXStatusBar; //导入依赖的package包/类
@Override
protected void addMacDefaults(LookAndFeelAddons addon, DefaultsList defaults) {
    super.addMacDefaults(addon, defaults);
    
    defaults.add(JXStatusBar.uiClassID,
            "org.jdesktop.swingx.plaf.macosx.MacOSXStatusBarUI");
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:8,代码来源:StatusBarAddon.java


示例10: addMetalDefaults

import org.jdesktop.swingx.JXStatusBar; //导入依赖的package包/类
@Override
protected void addMetalDefaults(LookAndFeelAddons addon, DefaultsList defaults) {
    super.addMetalDefaults(addon, defaults);
    
    defaults.add(JXStatusBar.uiClassID,
            "org.jdesktop.swingx.plaf.metal.MetalStatusBarUI");
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:8,代码来源:StatusBarAddon.java


示例11: installDefaults

import org.jdesktop.swingx.JXStatusBar; //导入依赖的package包/类
protected void installDefaults(JXStatusBar sb) {
    //only set the border if it is an instanceof UIResource
    //In other words, only replace the border if it has not been
    //set by the developer. UIResource is the flag we use to indicate whether
    //the value was set by the UIDelegate, or by the developer.
    Border b = statusBar.getBorder();
    if (b == null || b instanceof UIResource) {
        statusBar.setBorder(createBorder());
    }
    
    LookAndFeel.installProperty(sb, "opaque", Boolean.TRUE);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:13,代码来源:BasicStatusBarUI.java


示例12: installListeners

import org.jdesktop.swingx.JXStatusBar; //导入依赖的package包/类
/**
 * Create and install the listeners for the status bar.
 * This method is called when the UI is installed.
 */
protected void installListeners(JXStatusBar sb) {
    if ((mouseListener = createMouseListener()) != null) {
        statusBar.addMouseListener(mouseListener);
    }
    
    if ((mouseMotionListener = createMouseMotionListener()) != null) {
        statusBar.addMouseMotionListener(mouseMotionListener);
    }
    
    if ((propertyChangeListener = createPropertyChangeListener()) != null) {
        statusBar.addPropertyChangeListener(propertyChangeListener);
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:18,代码来源:BasicStatusBarUI.java


示例13: uninstallListeners

import org.jdesktop.swingx.JXStatusBar; //导入依赖的package包/类
/**
 * Remove the installed listeners from the status bar.
 * The number and types of listeners removed in this method should be
 * the same that were added in <code>installListeners</code>
 */
protected void uninstallListeners(JXStatusBar sb) {
    if (mouseListener != null) {
        statusBar.removeMouseListener(mouseListener);
    }
    
    if (mouseMotionListener != null) {
        statusBar.removeMouseMotionListener(mouseMotionListener);
    }
    
    if (propertyChangeListener != null) {
        statusBar.removePropertyChangeListener(propertyChangeListener);
    }
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:19,代码来源:BasicStatusBarUI.java


示例14: paintSeparator

import org.jdesktop.swingx.JXStatusBar; //导入依赖的package包/类
protected void paintSeparator(Graphics2D g, JXStatusBar bar, int x, int y, int w, int h) {
    Color fg = UIManagerExt.getSafeColor("Separator.foreground", Color.BLACK);
    Color bg = UIManagerExt.getSafeColor("Separator.background", Color.WHITE);
    
    x += w / 2;
    g.setColor(fg);
    g.drawLine(x, y, x, h);
    
    g.setColor(bg);
    g.drawLine(x+1, y, x+1, h);
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:12,代码来源:BasicStatusBarUI.java


示例15: createStatusBar

import org.jdesktop.swingx.JXStatusBar; //导入依赖的package包/类
protected Container createStatusBar() {

        JXStatusBar statusBar = new JXStatusBar();
        statusBar.putClientProperty("auto-add-separator", Boolean.FALSE);
        // Left status area
        statusBar.add(Box.createRigidArea(new Dimension(10, 22)));
        statusBarLeft = Box.createHorizontalBox();
        statusBar.add(statusBarLeft, JXStatusBar.Constraint.ResizeBehavior.FILL);
        actionStatus = new JLabel();
        actionStatus.setName("loadingStatusLabel");
        actionStatus.setHorizontalAlignment(JLabel.LEADING);
        statusBarLeft.add(actionStatus);

        // Middle (should stretch)
//        statusBar.add(Box.createHorizontalGlue());
//        statusBar.add(Box.createHorizontalGlue());
        statusBar.add(Box.createVerticalGlue());
        statusBar.add(Box.createRigidArea(new Dimension(50, 0)));

        // Right status area
        tableStatus = new JLabel(); 
        tableStatus.setName("rowCountLabel");
        JComponent bar = Box.createHorizontalBox();
        bar.add(tableStatus);
        tableRows = new JLabel("0");
        bar.add(tableRows);
        
        statusBar.add(bar);
        statusBar.add(Box.createHorizontalStrut(12));
        return statusBar;
    }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:32,代码来源:XTableDemo.java


示例16: MusicMediaMatrixPanel

import org.jdesktop.swingx.JXStatusBar; //导入依赖的package包/类
public MusicMediaMatrixPanel() {
    initComponents();
    add(new TonalityColorPanel(), BorderLayout.SOUTH);
    final JXStatusBar bar = new JXStatusBar();
    statusLabel = new JLabel();
    final JXStatusBar.Constraint c1 = new JXStatusBar.Constraint();
    bar.add(statusLabel, c1);
    add(bar, BorderLayout.SOUTH);
}
 
开发者ID:shuichi,项目名称:MediaMatrix,代码行数:10,代码来源:MusicMediaMatrixPanel.java


示例17: MainWindow

import org.jdesktop.swingx.JXStatusBar; //导入依赖的package包/类
/**
 * Creates new form MainFrame
 */
public MainWindow() {
    initComponents();
    menuItemCopy.addActionListener(new DefaultEditorKit.CopyAction());
    menuItemCut.addActionListener(new DefaultEditorKit.CutAction());
    menuItemPaste.addActionListener(new DefaultEditorKit.PasteAction());
    setActionCommands();
    filterManager = new FilterManager();
    actionHandler = new ActionHandler(this, tmData, filterManager);
    actionHandler.setModelMediator(this);
    tmView = new TmView(actionHandler);
    alignToolBar = new AlignToolBar(actionHandler);
    editToolBar = new EditToolBar(actionHandler);
    editLeftSegment.setModelMediator(this);
    editRightSegment.setModelMediator(this);
    labelStatusBar = new JXLabel(" ");
    panelStatusBar = new JXStatusBar();
    msp = new JXMultiSplitPane();
    tableRows = new JXLabel(" ");
    makeUi();
    getContentPane().add(toolBar, BorderLayout.NORTH);
    getContentPane().add(msp);
    getContentPane().add(panelStatusBar, BorderLayout.SOUTH);
    setTitle(AppConstants.getDisplayNameAndVersion());

    if (Platform.isMacOsx()) {
        setMacProxy();
    }
    setCloseHandler();
    setMainFrameSize();
}
 
开发者ID:miurahr,项目名称:tmpotter,代码行数:34,代码来源:MainWindow.java


示例18: createStatusBar

import org.jdesktop.swingx.JXStatusBar; //导入依赖的package包/类
public static JXStatusBar createStatusBar(final JComponent comp) {
    final JXStatusBar statusBar = new JXStatusBar();
    statusBar.setUI(new MetalStatusBarUI());
    statusBar.putClientProperty(BasicStatusBarUI.AUTO_ADD_SEPARATOR, false);
    statusBar.setBackground(WidgetUtils.BG_COLOR_DARKEST);
    final MatteBorder outerBorder = new MatteBorder(1, 0, 0, 0, WidgetUtils.BG_COLOR_LESS_DARK);
    final EmptyBorder innerBorder = new EmptyBorder(2, 2, 2, 2);
    statusBar.setBorder(new CompoundBorder(outerBorder, innerBorder));
    final JXStatusBar.Constraint c1 = new JXStatusBar.Constraint(JXStatusBar.Constraint.ResizeBehavior.FILL);
    statusBar.add(comp, c1);
    return statusBar;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:13,代码来源:WidgetFactory.java


示例19: getDialogContent

import org.jdesktop.swingx.JXStatusBar; //导入依赖的package包/类
@Override
protected JComponent getDialogContent() {
    final DCPanel formPanel = new DCPanel();

    // temporary variable to make it easier to refactor the layout
    WidgetUtils.addToGridBag(DCLabel.bright("Datastore name:"), formPanel, 0, 0);
    WidgetUtils.addToGridBag(_datastoreNameField, formPanel, 1, 0);

    final DCPanel checkBoxPanel = new DCPanel().setTitledBorder("Contained datastores");
    checkBoxPanel.setLayout(new VerticalLayout(4));

    for (final JCheckBox checkBox : _checkBoxes) {
        checkBoxPanel.add(checkBox);
    }

    final JScrollPane checkBoxScrollPane = WidgetUtils.scrolleable(checkBoxPanel);
    checkBoxScrollPane.setPreferredSize(new Dimension(checkBoxPanel.getWidth(), 300));
    checkBoxScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    checkBoxScrollPane.setBackground(_outerPanel.getBackground());
    WidgetUtils.addToGridBag(checkBoxScrollPane, formPanel, 0, 1, 2, 1);

    final DCPanel buttonPanel = getButtonPanel();

    final DCPanel centerPanel = new DCPanel();
    centerPanel.setLayout(new VerticalLayout(4));
    centerPanel.add(formPanel);
    centerPanel.add(buttonPanel);

    final JXStatusBar statusBar = WidgetFactory.createStatusBar(_statusLabel);

    _outerPanel.setLayout(new BorderLayout());
    _outerPanel.add(centerPanel, BorderLayout.CENTER);
    _outerPanel.add(statusBar, BorderLayout.SOUTH);

    return _outerPanel;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:37,代码来源:CompositeDatastoreDialog.java


示例20: init

import org.jdesktop.swingx.JXStatusBar; //导入依赖的package包/类
private void init() {
	JComponent pbar = new JPanel(new FormLayout("pref", 
			(OSInfo.isMacOs() ? "10px" : "pref")));
	progressBar = new JProgressBar(SwingConstants.HORIZONTAL);
	progressBar.setIndeterminate(false);
	progressBar.setValue(0);
	pbar.add(progressBar, (new CellConstraints()).xy(1, 1));
	
	progressLabel = new JLabel();
	progressLabel.setFont(FontPreferences.getSmallFont());
	
	add(progressLabel, new JXStatusBar.Constraint(200));
	add(pbar, new JXStatusBar.Constraint(120));
	add(new JLabel(), new JXStatusBar.Constraint(5));
}
 
开发者ID:phon-ca,项目名称:phon,代码行数:16,代码来源:NodeEditorStatusBar.java



注:本文中的org.jdesktop.swingx.JXStatusBar类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java EditLogOutputStream类代码示例发布时间:2022-05-22
下一篇:
Java MongoCursor类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap