• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java WebToggleButton类的典型用法和代码示例

java 4次浏览

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

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

示例1: ButtonListener

点赞 2

import com.alee.laf.button.WebToggleButton; //导入依赖的package包/类
/**
 * The class constructor. Initialise object variables.
 *
 * @param aCanvas The main canvas object.
 * @param pencilToolButton The draw button from the toolbar.
 * @param undoToolButton The undo button from the toolbar.
 * @param redoToolButton The redo button from the toolbar.
 * @param clearToolButton The clear canvas button from the toolbar.
 * @param aComboBox The colour picker from the toolbar.
 * @param lineCombo The line thickness combo box from the toolbar.
 * @param aSquareRadio The square footprint radio button from the toolbar.
 * @param aCircleRadio The circle footprint radio button from the toolbar.
 * @param cursor The cursor of the application.
 * @param drawableLine The Drawable object.
 * @param drawableCircle The Drawable object.
 * @param drawableSquare The Drawable object.
 * @param drawableEllipse The Drawable object.
 * @param drawableTriangle The Drawable object.
 * @param image The image button initialiser.
 */
public ButtonListener(DrawCanvas aCanvas, JButton pencilToolButton,
        JButton undoToolButton, JButton redoToolButton,
        JButton clearToolButton, WebColorChooserField aComboBox,
        WebComboBox lineCombo, JRadioButton aSquareRadio,
        JRadioButton aCircleRadio, Image cursor,
        WebToggleButton drawableLine, WebToggleButton drawableCircle,
        WebToggleButton drawableSquare, WebToggleButton drawableEllipse,
        WebToggleButton drawableTriangle, JButton image) {
    this.aCanvas = aCanvas;
    this.pencilToolButton = pencilToolButton;
    this.undoToolButton = undoToolButton;
    this.redoToolButton = redoToolButton;
    this.clearToolButton = clearToolButton;
    
    this.colorComboBox = aComboBox;
    this.lineComboBox = lineCombo;
    this.radioSquare = aSquareRadio;
    this.radioCircle = aCircleRadio;
    this.cursor = cursor;
    
    this.drawableLine = drawableLine;
    this.drawableCircle = drawableCircle;
    this.drawableSquare = drawableSquare;
    this.drawableEllipse = drawableEllipse;
    this.drawableTriangle = drawableTriangle;
    
    this.imageButton = image;
    this.imageChooser = null;
    this.file = null;
}
 

开发者ID:Daytron,
项目名称:J-Painter,
代码行数:51,
代码来源:ButtonListener.java

示例2: createListPanel

点赞 2

import com.alee.laf.button.WebToggleButton; //导入依赖的package包/类
private static WebPanel createListPanel(final WebTable list,
                                        String overlayText,
                                        WebToggleButton button) {
    // overlay for empty list
    WebOverlay listOverlay = new WebOverlay(list);
    listOverlay.setOverlayMargin(20);
    final WebTextArea overlayArea = new WebTextArea();
    overlayArea.setText(overlayText);
    overlayArea.setLineWrap(true);
    overlayArea.setWrapStyleWord(true);
    overlayArea.setMargin(View.MARGIN_DEFAULT);
    overlayArea.setFontSize(View.FONT_SIZE_BIG);
    overlayArea.setEditable(false);
    BorderPainter<WebTextArea> borderPainter = new BorderPainter<>(Color.LIGHT_GRAY);
    borderPainter.setRound(15);
    overlayArea.setPainter(borderPainter);
    list.getModel().addTableModelListener(new TableModelListener() {
        @Override
        public void tableChanged(TableModelEvent e) {
            overlayArea.setVisible(list.getModel().getRowCount() == 0);
        }
    });
    overlayArea.setVisible(list.getModel().getRowCount() == 0);
    listOverlay.addOverlay(overlayArea, SwingConstants.CENTER, SwingConstants.CENTER);

    WebScrollPane scrollPane = new ComponentUtils.ScrollPane(listOverlay);
    scrollPane.setDrawBorder(false);

    // button as overlay
    button.setOpaque(false);
    button.setUndecorated(true);
    WebOverlay chatListOverlay = new WebOverlay(scrollPane,
            button, SwingConstants.TRAILING, SwingConstants.BOTTOM);
    chatListOverlay.setOverlayMargin(0, 0, View.GAP_BIG, View.GAP_BIG + SCROLL_BAR_WIDTH);
    // fixing overlay button paint bug on startup, dont wanna know whats happening here
    SwingUtils.delayInvokeLater(0, new Runnable() {
        @Override
        public void run() {
            TooltipManager.showOneTimeTooltip(list, new Point(1,1), "");
        }
    });

    return chatListOverlay;
}
 

开发者ID:kontalk,
项目名称:desktopclient-java
代码行数:45,
代码来源:MainFrame.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)