当前位置: 首页>>代码示例>>Java>>正文


Java JToolBar.setRollover方法代码示例

本文整理汇总了Java中javax.swing.JToolBar.setRollover方法的典型用法代码示例。如果您正苦于以下问题:Java JToolBar.setRollover方法的具体用法?Java JToolBar.setRollover怎么用?Java JToolBar.setRollover使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JToolBar的用法示例。


在下文中一共展示了JToolBar.setRollover方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: MainToolBar

import javax.swing.JToolBar; //导入方法依赖的package包/类
MainToolBar(@NonNull final Pair<JComponent,GridBagConstraints>... components) {
    super(BoxLayout.X_AXIS);
    setBorder(BorderFactory.createEmptyBorder(1, 2, 1, 5));
    final JToolBar toolbar = new NoBorderToolBar(JToolBar.HORIZONTAL);
    toolbar.setFloatable(false);
    toolbar.setRollover(true);
    toolbar.setBorderPainted(false);
    toolbar.setBorder(BorderFactory.createEmptyBorder());
    toolbar.setOpaque(false);
    toolbar.setFocusable(false);
    toolbar.setLayout(new GridBagLayout());
    for (Pair<JComponent,GridBagConstraints> p : components) {
        toolbar.add(p.first(),p.second());
    }
    add (toolbar);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:HierarchyTopComponent.java

示例2: initComponents

import javax.swing.JToolBar; //导入方法依赖的package包/类
private void initComponents() {
    setLayout (new BorderLayout ());
    contentComponent = new javax.swing.JPanel(new BorderLayout ());
    add (contentComponent, BorderLayout.CENTER);  //NOI18N
    JToolBar toolBar = new JToolBar(JToolBar.VERTICAL);
    toolBar.setFloatable(false);
    toolBar.setRollover(true);
    toolBar.setBorderPainted(true);
    if( "Aqua".equals(UIManager.getLookAndFeel().getID()) ) { //NOI18N
        toolBar.setBackground(UIManager.getColor("NbExplorerView.background")); //NOI18N
    }
    toolBar.setBorder(javax.swing.BorderFactory.createCompoundBorder(
            javax.swing.BorderFactory.createMatteBorder(0, 0, 0, 1,
            javax.swing.UIManager.getDefaults().getColor("Separator.background")),
            javax.swing.BorderFactory.createMatteBorder(0, 0, 0, 1,
            javax.swing.UIManager.getDefaults().getColor("Separator.foreground"))));
    add(toolBar, BorderLayout.WEST);
    JComponent buttonsPane = toolBar;
    viewModelListener = new ViewModelListener (
        name,
        contentComponent,
        buttonsPane,
        propertiesHelpID,
        ImageUtilities.loadImage(icon)
    );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:ViewComponent.java

示例3: ToolBarDemo2

import javax.swing.JToolBar; //导入方法依赖的package包/类
public ToolBarDemo2() {
    super(new BorderLayout());

    // Create the toolbar.
    JToolBar toolBar = new JToolBar("Still draggable");
    addButtons(toolBar);
    toolBar.setFloatable(false);
    toolBar.setRollover(true);

    // Create the text area used for output. Request
    // enough space for 5 rows and 30 columns.
    textArea = new JTextArea(5, 30);
    textArea.setEditable(false);
    JScrollPane scrollPane = new JScrollPane(textArea);

    // Lay out the main panel.
    setPreferredSize(new Dimension(450, 130));
    add(toolBar, BorderLayout.PAGE_START);
    add(scrollPane, BorderLayout.CENTER);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:21,代码来源:ToolBarDemo2.java

示例4: installDefaults

import javax.swing.JToolBar; //导入方法依赖的package包/类
public void installDefaults (AbstractButton b) {
       super.installDefaults(b);
if(!defaults_initialized) {
           hiddenToggle = new JToggleButton();
           hiddenToggle.setText("");
           JToolBar bar = new JToolBar();
           bar.setRollover(true);
           bar.add(hiddenToggle);
    defaults_initialized = true;
}
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:GtkSlidingButtonUI.java

示例5: installDefaults

import javax.swing.JToolBar; //导入方法依赖的package包/类
@Override
   public void installDefaults (AbstractButton b) {
       super.installDefaults(b);
if(!defaults_initialized) {
           hiddenToggle = new JToggleButton();
           hiddenToggle.setText("");
           JToolBar bar = new JToolBar();
           bar.setRollover(true);
           bar.add(hiddenToggle);
    defaults_initialized = true;
}
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:NimbusSlidingButtonUI.java

示例6: initPanel

import javax.swing.JToolBar; //导入方法依赖的package包/类
/** Called only from AWT */
private void initPanel () {
    setBorder(new EmptyBorder(1, 2, 3, 5));

    // configure toolbar
    JToolBar toolbar = new JToolBar(JToolBar.HORIZONTAL);
    toolbar.setFloatable(false);
    toolbar.setRollover(true);
    toolbar.setBorderPainted(false);
    // create toggle buttons
    int filterCount = filtersDesc.getFilterCount();
    toggles = new ArrayList<JToggleButton>(filterCount);
    JToggleButton toggleButton = null;
    
    Map<String,Boolean> fStates = new HashMap<String, Boolean>(filterCount * 2);

    for (int i = 0; i < filterCount; i++) {
        toggleButton = createToggle(fStates, i);
        toggles.add(toggleButton);
    }
    
    // add toggle buttons
    JToggleButton curToggle;
    Dimension space = new Dimension(3, 0);
    for (int i = 0; i < toggles.size(); i++) {
        curToggle = toggles.get(i);
        curToggle.addActionListener(this);
        toolbar.add(curToggle);
        if (i != toggles.size() - 1) {
            toolbar.addSeparator(space);
        }
    }
    
    add(toolbar);
    
    // initialize member states map
    synchronized (STATES_LOCK) {
        filterStates = fStates;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:41,代码来源:FiltersManager.java

示例7: createToolbar

import javax.swing.JToolBar; //导入方法依赖的package包/类
/**
     */
    private JComponent createToolbar() {
        createShowButtons();
        createNextPrevFailureButtons();
        createRerunButtons();
	createOptionButtons();
        String testingFramework = Manager.getInstance().getTestingFramework();

        JToolBar toolbar = new ToolbarWithOverflow(SwingConstants.VERTICAL);
        toolbar.add(rerunButton);
        toolbar.add(rerunFailedButton);
        toolbar.add(new JToolBar.Separator());
        toolbar.add(btnShowPassed);
        if(testingFramework.equals(Manager.TESTNG_TF)) {
            toolbar.add(btnShowPassedWithErrors);
        }
        toolbar.add(btnShowFailed);
        toolbar.add(btnShowError);
        toolbar.add(btnShowAborted);
//        if(testingFramework.equals(Manager.TESTNG_TF) || testingFramework.equals(Manager.JUNIT_TF)) {
//            toolbar.add(btnShowIgnored);
//        }
        toolbar.add(btnShowSkipped);
	
        toolbar.add(new JToolBar.Separator());
        toolbar.add(previousFailure);
        toolbar.add(nextFailure);
        toolbar.add(new JToolBar.Separator());
        toolbar.add(btnAlwaysOpenTRW);
	toolbar.add(btnAlwaysOpenNewTab);
        
        toolbar.setFocusable(false);
        toolbar.setRollover(true);
        toolbar.setFloatable(false);
        return toolbar;
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:38,代码来源:StatisticsPanel.java

示例8: createActionsToolbar

import javax.swing.JToolBar; //导入方法依赖的package包/类
private static JToolBar createActionsToolbar() {
    JToolBar jt = new JToolBar(JToolBar.HORIZONTAL);
    jt.setBorder(new EmptyBorder(0, 0, 0, 0));
    jt.setFloatable(false);
    jt.setRollover(false);
    return jt;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:WatchAnnotationProvider.java

示例9: initializeMainPanel

import javax.swing.JToolBar; //导入方法依赖的package包/类
private JPanel initializeMainPanel(boolean nbOutputComponent) {

        JPanel panel = new JPanel();
        panel.setBorder(BorderFactory.createEtchedBorder());
        panel.setLayout(new BoxLayout(panel, BoxLayout.LINE_AXIS));

        ActionListener outputListener = createOutputListener();
        initVerticalToolbar(outputListener);

        JToolBar toolbarWest = new JToolBar();
        toolbarWest.setFloatable(false);
        toolbarWest.setRollover(true);
        initToolbarWest(toolbarWest, outputListener, nbOutputComponent);
        
        JToolBar toolbarEast = new JToolBar();
        toolbarEast.setFloatable(false);
        toolbarEast.setRollover(true);
        initToolbarEast(toolbarEast);
        toolbarEast.setMinimumSize(toolbarWest.getPreferredSize());
        toolbarEast.setSize(toolbarWest.getPreferredSize());
        toolbarEast.setMaximumSize(toolbarWest.getPreferredSize());

        panel.add(toolbarWest);
        panel.add(Box.createHorizontalGlue());
        panel.add(toolbarEast);

        return panel;
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:29,代码来源:DataViewUI.java

示例10: MainPanel

import javax.swing.JToolBar; //导入方法依赖的package包/类
public MainPanel(Backend backend, Parameters params)
{
	this.backend = backend;
	fileList = new FileListPanel(backend);
	fileList.setBorder(BorderFactory.createLineBorder(Color.BLACK, 1));

	toolBar = new JToolBar();
	toolBar.setLayout(new ExpandLayout()
	{
		@Override
		public Component createComponent(Action a)
		{
			return new JButton(a);
		}
	});
	toolBar.setFloatable(false);
	toolBar.setRollover(true);

	setupActions(params);

	setLayout(new BorderLayout());
	add(toolBar, BorderLayout.NORTH);
	add(fileList, BorderLayout.CENTER);

	// TODO: Temporary
	FileInfo root = new FileInfo();
	root.setDirectory(true);
	fileList.setCwd(root);
}
 
开发者ID:equella,项目名称:Equella,代码行数:30,代码来源:MainPanel.java

示例11: getToolbar

import javax.swing.JToolBar; //导入方法依赖的package包/类
private JToolBar getToolbar() {
    JToolBar tbar = new javax.swing.JToolBar();
    tbar.setFloatable(false);
    tbar.setRollover(true);
    tbar.setBorderPainted(false);
    return tbar;
}
 
开发者ID:CognizantQAHub,项目名称:Cognizant-Intelligent-Test-Scripter,代码行数:8,代码来源:JSList.java

示例12: initGUI

import javax.swing.JToolBar; //导入方法依赖的package包/类
/**
 * Initialize all gui related stuff
 */
private void initGUI() {
	// Sets default title, close operation and dimensions
	this.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
	this.setIconImage(JMTImageLoader.loadImage("Results").getImage());
	this.centerWindow(CommonConstants.MAX_GUI_WIDTH_JSIM_RESULTS, CommonConstants.MAX_GUI_HEIGHT_JSIM_RESULTS);

	// Creates all tabs
	JTabbedPane mainPanel = new JTabbedPane();
	this.getContentPane().setLayout(new BorderLayout());
	this.getContentPane().add(mainPanel, BorderLayout.CENTER);
	addTabPane(mainPanel, SimulationDefinition.MEASURE_QL, DESCRIPTION_QUEUE_LENGTH, results.getQueueLengthMeasures());
	addTabPane(mainPanel, SimulationDefinition.MEASURE_QT, DESCRIPTION_QUEUE_TIME, results.getQueueTimeMeasures());
	addTabPane(mainPanel, SimulationDefinition.MEASURE_RP, DESCRIPTION_RESPONSE_TIME, results.getResponseTimeMeasures());
	addTabPane(mainPanel, SimulationDefinition.MEASURE_RD, DESCRIPTION_RESIDENCE_TIME, results.getResidenceTimeMeasures());
	addTabPane(mainPanel, SimulationDefinition.MEASURE_U, DESCRIPTION_UTILIZATION, results.getUtilizationMeasures());
	addTabPane(mainPanel, SimulationDefinition.MEASURE_X, DESCRIPTION_THROUGHPUT, results.getThroughputMeasures());
	addTabPane(mainPanel, SimulationDefinition.MEASURE_DR, DESCRIPTION_DROP_RATE, results.getDropRateMeasures());
	addTabPane(mainPanel, SimulationDefinition.MEASURE_S_CN, DESCRIPTION_SYSTEM_CUSTOMER_NUMBER, results.getSystemCustomerNumberMeasures());
	addTabPane(mainPanel, SimulationDefinition.MEASURE_S_RP, DESCRIPTION_SYSTEM_RESPONSE_TIME, results.getSystemResponseTimeMeasures());
	addTabPane(mainPanel, SimulationDefinition.MEASURE_S_X, DESCRIPTION_SYSTEM_THROUGHPUT, results.getSystemThroughputMeasures());
	addTabPane(mainPanel, SimulationDefinition.MEASURE_S_DR, DESCRIPTION_SYSTEM_DROP_RATE, results.getSystemDropRateMeasures());
	addTabPane(mainPanel, SimulationDefinition.MEASURE_S_P, DESCRIPTION_SYSTEM_POWER, results.getSystemPowerMeasures());
	addTabPane(mainPanel, SimulationDefinition.MEASURE_RP_PER_SINK, DESCRIPTION_RESPONSE_TIME_PER_SINK, results.getResponsetimePerSinkMeasures());
	addTabPane(mainPanel, SimulationDefinition.MEASURE_X_PER_SINK, DESCRIPTION_THROUGHPUT_PER_SINK, results.getThroughputPerSinkMeasures());
	addTabPane(mainPanel, SimulationDefinition.MEASURE_FCR_TW, DESCRIPTION_FCR_TOTAL_WEIGHT, results.getFCRTotalWeightMeasures());
	addTabPane(mainPanel, SimulationDefinition.MEASURE_FCR_MO, DESCRIPTION_FCR_MEMORY_OCCUPATION, results.getFCRMemoryOccupationMeasures());	
	addTabPane(mainPanel, SimulationDefinition.MEASURE_FJ_CN, DESCRIPTION_FJ_CUSTOMER_NUMBER, results.getFJCustomerNumberMeasures());
	addTabPane(mainPanel, SimulationDefinition.MEASURE_FJ_RP, DESCRIPTION_FJ_RESPONSE_TIME, results.getFJResponseTimeMeasures());
	addTabPane(mainPanel, SimulationDefinition.MEASURE_FX, DESCRIPTION_FIRING_THROUGHPUT, results.getFiringThroughputMeasures());
	// Creates bottom toolbar
	JToolBar toolbar = new JToolBar();
	toolbar.setFloatable(false);
	toolbar.setRollover(true);
	start = new JButton();
	toolbar.add(start);
	start.setVisible(false);
	pause = new JButton();
	toolbar.add(pause);
	pause.setVisible(false);
	stop = new JButton();
	toolbar.add(stop);
	stop.setVisible(false);
	// Adds a progress bar
	progressBar = new JProgressBar();
	progressBar.setStringPainted(true);
	progressBar.setForeground(Color.BLUE);
	UIManager.put("ProgressBar.selectionForeground", Color.WHITE);
	setProgressBar(results.getProgress(), results.getElapsedTime());
	toolbar.add(progressBar);
	// Add close window button
	JButton close = new JButton();
	close.setIcon(JMTImageLoader.loadImage("Close"));
	close.setFocusPainted(false);
	close.setContentAreaFilled(false);
	close.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
	close.setRolloverIcon(JMTImageLoader.loadImage("CloseRO"));
	close.setPressedIcon(JMTImageLoader.loadImage("CloseP"));
	close.setVisible(true);
	close.setToolTipText("Closes this window");
	close.addActionListener(new ActionListener() {
		// Fires a window closing event
		public void actionPerformed(ActionEvent e) {
			ResultsWindow.this.dispatchEvent(new WindowEvent(ResultsWindow.this, WindowEvent.WINDOW_CLOSING));
		}
	});

	toolbar.add(close);
	// Adds toolbar
	this.getContentPane().add(toolbar, BorderLayout.SOUTH);

	// Adds listener for progressBar
	results.setProgressListener(new MeasureDefinition.ProgressListener() {
		public void progressChanged(double progress, long elapsedTime) {
			setProgressBar(progress, elapsedTime);
		}
	});
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:81,代码来源:ResultsWindow.java

示例13: initGUI

import javax.swing.JToolBar; //导入方法依赖的package包/类
/**
 * Initialize allgui related stuff
 */
private void initGUI() {
	// Sets default title, close operation and dimensions
	this.setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
	this.setTitle("Simulation Results...");
	this.setIconImage(JMTImageLoader.loadImage("Results").getImage());
	int width = 800, height = 500;
	this.centerWindow(width, height);

	// Creates all tabs
	JTabbedPane mainPanel = new JTabbedPane();
	this.getContentPane().setLayout(new BorderLayout());
	this.getContentPane().add(mainPanel, BorderLayout.CENTER);
	addTabPane(mainPanel, "Number of Customers", DESCRIPTION_QUEUELENGTHS, results.getQueueLengthMeasures());
	addTabPane(mainPanel, "Queue Time", DESCRIPTION_QUEUETIMES, results.getQueueTimeMeasures());
	addTabPane(mainPanel, "Residence Time", DESCRIPTION_RESIDENCETIMES, results.getResidenceTimeMeasures());
	addTabPane(mainPanel, "Response Time", DESCRIPTION_RESPONSETIMES, results.getResponseTimeMeasures());
	addTabPane(mainPanel, "Utilization", DESCRIPTION_UTILIZATIONS, results.getUtilizationMeasures());
	addTabPane(mainPanel, "Throughput", DESCRIPTION_THROUGHPUTS, results.getThroughputMeasures());
	addTabPane(mainPanel, "Drop Rate", DESCRIPTION_DROPRATE, results.getDropRateMeasures());
	addTabPane(mainPanel, "System Response Time", DESCRIPTION_SYSTEMRESPONSETIMES, results.getSystemResponseTimeMeasures());
	addTabPane(mainPanel, "System Throughput", DESCRIPTION_SYSTEMTHROUGHPUTS, results.getSystemThroughputMeasures());
	addTabPane(mainPanel, "System Drop Rate", DESCRIPTION_DROPRATE, results.getSystemDropRateMeasures());
	addTabPane(mainPanel, "System Number of Customers", DESCRIPTION_CUSTOMERNUMBERS, results.getCustomerNumberMeasures());
	//Added by ASHANKA START
	//Adds the System Power panel in the results window
	addTabPane(mainPanel, "System Power", DESCRIPTION_SYSTEMPOWER, results.getSystemPowerMeasures());
	//Added by ASHANKA STOP
	addTabPane(mainPanel, SimulationDefinition.MEASURE_R_PER_SINK, DESCRIPTION_RESPONSETIME_SINK, results.getResponsetimePerSinkMeasures());
	addTabPane(mainPanel, SimulationDefinition.MEASURE_X_PER_SINK, DESCRIPTION_THROUGHPUT_SINK, results.getThroughputPerSinkMeasures());
	// Creates bottom toolbar
	JToolBar toolbar = new JToolBar();
	toolbar.setFloatable(false);
	toolbar.setRollover(true);
	start = new JButton();
	toolbar.add(start);
	start.setVisible(false);
	pause = new JButton();
	toolbar.add(pause);
	pause.setVisible(false);
	stop = new JButton();
	toolbar.add(stop);
	stop.setVisible(false);
	// Adds a progress bar
	progressBar = new JProgressBar();
	progressBar.setStringPainted(true);
	progressBar.setForeground(Color.BLUE);
	setProgressBar(results.getProgressTime());
	toolbar.add(progressBar);
	// Add close window button
	JButton close = new JButton();
	close.setIcon(JMTImageLoader.loadImage("Close"));
	close.setFocusPainted(false);
	close.setContentAreaFilled(false);
	close.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
	close.setRolloverIcon(JMTImageLoader.loadImage("CloseRO"));
	close.setPressedIcon(JMTImageLoader.loadImage("CloseP"));
	close.setVisible(true);
	close.setToolTipText("Closes this window");
	close.addActionListener(new ActionListener() {
		// Fires a window closing event
		public void actionPerformed(ActionEvent e) {
			ResultsWindow.this.dispatchEvent(new WindowEvent(ResultsWindow.this, WindowEvent.WINDOW_CLOSING));
		}
	});

	toolbar.add(close);
	// Adds toolbar
	this.getContentPane().add(toolbar, BorderLayout.SOUTH);

	// Adds listener for progressBar
	results.setProgressTimeListener(new MeasureDefinition.ProgressTimeListener() {
		public void timeChanged(double time) {
			setProgressBar(time);
		}
	});

}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:81,代码来源:ResultsWindow.java


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