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


Java JPanel.revalidate方法代码示例

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


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

示例1: sdkValid

import javax.swing.JPanel; //导入方法依赖的package包/类
@Override
public void sdkValid() {
    fireIconChange();
    fireOpenedIconChange();
    setChildren(Children.create(new AndroidPlatformChildrenFactory(platform, holder), false));
    JPanel tmp = lastBrokenPanel.get();
    if (tmp != null) {
        tmp.removeAll();
        tmp.invalidate();
        tmp.repaint();
        tmp.setLayout(new java.awt.CardLayout());
        tmp.add(new AndroidSdkCustomizer(platform, holder));
        tmp.revalidate();
        tmp.repaint();
        tmp.requestFocus();
    }
}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:18,代码来源:AndroidSdkNode.java

示例2: updateCustomizer

import javax.swing.JPanel; //导入方法依赖的package包/类
public void updateCustomizer() {
    if (valid != platform.isValid()) {
        valid = platform.isValid();
        setChildren(Children.create(new AndroidPlatformChildrenFactory(platform, holder), false));
        JPanel tmp = lastBrokenPanel.get();
        if (tmp != null) {
            tmp.removeAll();
            tmp.invalidate();
            tmp.repaint();
            tmp.setLayout(new java.awt.CardLayout());
            if (platform.isValid()) {
                tmp.add(new AndroidSdkCustomizer(platform, holder));
            } else {
                tmp.add(new BrokenPlatformCustomizer(platform, holder, this));
            }
            tmp.revalidate();
            tmp.repaint();
            tmp.requestFocus();
        }
    }
}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:22,代码来源:AndroidSdkNode.java

示例3: contentChange

import javax.swing.JPanel; //导入方法依赖的package包/类
private void contentChange(DocumentEvent e) {
            changed = true;

            Document doc = e.getDocument();
            CodeCategory category = getCategoryForDocument(doc);
            int eBlockIndex = getEditBlockIndex(category, e.getOffset());
            if (eBlockIndex < 0) {
                return;
            }

            List<EditableLine> lines = getEditInfos(category)[eBlockIndex].lines;
            int[] blockBounds = getEditBlockBounds(category, eBlockIndex);
            boolean repaint = false;

            Integer lastLineCount = lastDocLineCounts.get(doc);
            int lineCount = getLineCount(doc);
            if (lastLineCount == null || lastLineCount.intValue() != lineCount) {
                lastDocLineCounts.put(doc, Integer.valueOf(lineCount));
                updateLines(doc, blockBounds[0], blockBounds[1], lines,
                            codeData.getEditableBlock(category, eBlockIndex));
                repaint = true;
                // make sure our listener is invoked after position listeners update
                doc.removeDocumentListener(this);
                doc.addDocumentListener(this);
            }

            repaint |= updateGutterComponents(lines, doc, blockBounds[0], blockBounds[1]);

            if (repaint) {
                JPanel gutter = getGutter(doc);
                gutter.revalidate();
                gutter.repaint();
            }
//            ((BaseDocument)doc).resetUndoMerge();
        }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:36,代码来源:CustomCodeView.java

示例4: getTableCellEditorComponent

import javax.swing.JPanel; //导入方法依赖的package包/类
@Override
public Component getTableCellEditorComponent(final JTable table, Object value, boolean isSelected, final int row, final int column) {
    final JComponent c = (JComponent) super.getTableCellEditorComponent(table, value, isSelected, row, column);      
    
    this.tableModel = table.getModel();
    this.columnName = table.getColumnName(column);
    this.modelRow = table.convertRowIndexToModel(row);
    this.modelColumn = table.convertColumnIndexToModel(column);  
    this.tc = c instanceof JTextComponent ? (JTextComponent) c : null;

    JPanel panel = new JPanel(new BorderLayout()) {
        @Override
        public void addNotify() {
            super.addNotify();
            c.requestFocus();
        }
    };
    panel.add(c);
    if (suppressEditorBorder) {
        c.setBorder(BorderFactory.createEmptyBorder());
    }
    panel.add(customEditorButton, BorderLayout.EAST);
    panel.revalidate();
    panel.repaint();

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

示例5: replacePage

import javax.swing.JPanel; //导入方法依赖的package包/类
public void replacePage(JPanel parent, JPanel child)
{
	parent.removeAll();
	parent.add(child);
	parent.revalidate();
	parent.repaint();
}
 
开发者ID:equella,项目名称:Equella,代码行数:8,代码来源:Wizard.java

示例6: setPanel

import javax.swing.JPanel; //导入方法依赖的package包/类
@Override
public void setPanel(JPanel imagePanel) {
	hostPanel=imagePanel;

	imagePanel.setPreferredSize(new Dimension(300,300));
	imagePanel.setLayout(new GridLayout());
	imagePanel.revalidate();
	imagePanel.add(this);
}
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:10,代码来源:ImageDisplayWriter.java

示例7: addGraphToFrame

import javax.swing.JPanel; //导入方法依赖的package包/类
public static void addGraphToFrame(final JPanel graph) {
  if (RelationModelEditor.frame == null) {
    RelationModelEditor.frame = SWT_AWT.new_Frame(RelationModelEditor.animationEditor);
  }
  if (RelationModelEditor.frame.getComponents().length > 0) {
    RelationModelEditor.frame.remove(0);
  }
  RelationModelEditor.frame.revalidate();
  graph.revalidate();
  RelationModelEditor.frame.add(graph);
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:12,代码来源:RelationModelEditor.java

示例8: updateCharts

import javax.swing.JPanel; //导入方法依赖的package包/类
/**
 * Updates the charts.
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
private void updateCharts() {
	for (int i = 0; i < listOfChartPanels.size(); i++) {
		JPanel panel = listOfChartPanels.get(i);
		panel.removeAll();
		final ChartPanel chartPanel = new ChartPanel(getModel().getChartOrNull(i)) {

			private static final long serialVersionUID = -6953213567063104487L;

			@Override
			public Dimension getPreferredSize() {
				return DIMENSION_CHART_PANEL_ENLARGED;
			}
		};
		chartPanel.setPopupMenu(null);
		chartPanel.setBackground(COLOR_TRANSPARENT);
		chartPanel.setOpaque(false);
		chartPanel.addMouseListener(enlargeAndHoverAndPopupMouseAdapter);
		panel.add(chartPanel, BorderLayout.CENTER);

		JPanel openChartPanel = new JPanel(new GridBagLayout());
		openChartPanel.setOpaque(false);

		GridBagConstraints gbc = new GridBagConstraints();
		gbc.anchor = GridBagConstraints.CENTER;
		gbc.fill = GridBagConstraints.NONE;
		gbc.weightx = 1.0;
		gbc.weighty = 1.0;

		JButton openChartButton = new JButton(OPEN_CHART_ACTION);
		openChartButton.setOpaque(false);
		openChartButton.setContentAreaFilled(false);
		openChartButton.setBorderPainted(false);
		openChartButton.addMouseListener(enlargeAndHoverAndPopupMouseAdapter);
		openChartButton.setHorizontalAlignment(SwingConstants.LEFT);
		openChartButton.setHorizontalTextPosition(SwingConstants.LEFT);
		openChartButton.setIcon(null);
		Font font = openChartButton.getFont();
		Map attributes = font.getAttributes();
		attributes.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
		openChartButton.setFont(font.deriveFont(attributes).deriveFont(10.0f));

		openChartPanel.add(openChartButton, gbc);

		panel.add(openChartPanel, BorderLayout.SOUTH);
		panel.revalidate();
		panel.repaint();
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:53,代码来源:AttributeStatisticsPanel.java

示例9: createRecoverButtonPanel

import javax.swing.JPanel; //导入方法依赖的package包/类
private JPanel createRecoverButtonPanel(final AutoSave autosave) {
    final JPanel buttonPanel = new JPanel();
    buttonPanel.setBackground(WARNING_BACKGROUND_COLOR);
    final JLabel recoverLabel = new JLabel(I18N.getGUILabel("getting_started.label.recover", new Object[0]));
    recoverLabel.setIcon(SwingTools.createIcon("16/loading.gif"));
    recoverLabel.setFont(GettingStartedDialog.OPEN_SANS_SEMIBOLD_14);
    recoverLabel.setForeground(WARNING_TEXT_COLOR);
    recoverLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 8, 0));
    String autosavedPath = autosave.getAutosavedPath();
    JButton recoverButton = new JButton(new ResourceAction("getting_started.recover", new Object[]{autosavedPath == null?"autosaved process":autosavedPath}) {
        private static final long serialVersionUID = 1L;

        public void actionPerformed(ActionEvent e) {
            if(OpenProcessCard.this.entryList != null) {
                OpenProcessCard.this.entryList.setFocusable(false);
            }

            buttonPanel.removeAll();
            buttonPanel.add(recoverLabel);
            buttonPanel.revalidate();
            (new ProgressThread("recover_process") {
                public void run() {
                    autosave.recoverAutosavedProcess();
                    SwingTools.invokeLater(new Runnable() {
                        public void run() {
                            if(OpenProcessCard.this.entryList != null) {
                                OpenProcessCard.this.entryList.setFocusable(true);
                            }

                            OpenProcessCard.this.owner.dispose();
                        }
                    });
                }
            }).start();
        }
    });
    this.styleButton(recoverButton);
    buttonPanel.add(recoverButton);
    this.owner.getRootPane().setDefaultButton(recoverButton);
    return buttonPanel;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:42,代码来源:OpenProcessCard.java

示例10: UpperToolbarActionListener

import javax.swing.JPanel; //导入方法依赖的package包/类
public ActionListener UpperToolbarActionListener(final JPanel mainPanel) {

        ActionListener actionListener = new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {

                if (e.getSource() == roomsBtn) {

                    theRooms = new Main_AllRooms();
                    infoColorTable = new ColorInfoTable();

                    // Set the usage of room into info table
                    infoColorTable.setCleanLabelCount(theRooms.cleanCounter);
                    infoColorTable.setDirtyLabelCount(theRooms.dirtyCounter);
                    infoColorTable.setDndLabelCount(theRooms.dndCounter);

                    mainPanel.removeAll();
                    mainPanel.add(theRooms.getWindow(), BorderLayout.WEST);
                    mainPanel.add(infoColorTable, BorderLayout.EAST);
                    mainPanel.revalidate();
                    mainPanel.repaint();

                } else if (e.getSource() == guestsBtn) {

                    customersFrame = new Main_CustomersFrame();
                    mainPanel.removeAll();
                    mainPanel.add(customersFrame, BorderLayout.CENTER);
                    mainPanel.revalidate();
                    mainPanel.repaint();
                } else if (e.getSource() == rezervationBtn) {

                    rezervFrame = new Main_Reservations();
                    mainPanel.removeAll();
                    rezervFrame.populateMainTable();
                    mainPanel.add(rezervFrame, BorderLayout.CENTER);
                    mainPanel.revalidate();
                    mainPanel.repaint();
                } else if (e.getSource() == blockadeBtn) {

                    blockadeFrame = new Main_Blockade();
                    mainPanel.removeAll();
                    mainPanel.add(blockadeFrame, BorderLayout.CENTER);
                    mainPanel.revalidate();
                    mainPanel.repaint();

                } else if (e.getSource() == roomCleaningBtn) {

                    cleaningFrame = new Main_RoomCleaning();
                    mainPanel.removeAll();
                    mainPanel.add(cleaningFrame, BorderLayout.CENTER);
                    mainPanel.revalidate();
                    mainPanel.repaint();
                } else if (e.getSource() == cashBtn) {

                    cashdesk = new Main_CashDesk();
                    mainPanel.removeAll();
                    mainPanel.add(cashdesk, BorderLayout.CENTER);
                    mainPanel.revalidate();
                    mainPanel.repaint();
                } else if (e.getSource() == auditBtn) {

                    audit = new Main_Audit();
                    audit.initializeAuditPane();
                    mainPanel.removeAll();
                    mainPanel.add(audit, BorderLayout.CENTER);
                    mainPanel.revalidate();
                    mainPanel.repaint();

                } else if (e.getSource() == refreshBtn) {
                    mainPanel.removeAll();
                    mainPanel.revalidate();
                    mainPanel.repaint();
                }
            }
        };
        return actionListener;
    }
 
开发者ID:Coder-ACJHP,项目名称:Hotel-Properties-Management-System,代码行数:79,代码来源:Main_UpperToolbar.java

示例11: attemptToShowFullUi

import javax.swing.JPanel; //导入方法依赖的package包/类
private void attemptToShowFullUi()
{
	if( tree != null )
	{
		return;
	}

	GlassSwingWorker<?> worker = new GlassSwingWorker<Boolean>()
	{
		private Map<String, Pair<String, String>> predefinedTermDataKeys;

		@Override
		public Boolean construct() throws Exception
		{
			boolean valid = taxonomy != null
				&& clientService.getService(RemoteTaxonomyService.class).identifyByUuid(taxonomy.getUuid()) != 0;
			if( valid )
			{
				predefinedTermDataKeys = new HashMap<String, Pair<String, String>>();
				for( Extension ext : pluginService.getConnectedExtensions("com.tle.admin.taxonomy.tool",
					"predefinedTermDataKey") )
				{
					final String key = ext.getParameter("key").valueAsString();
					final String name = CurrentLocale.get(ext.getParameter("name").valueAsString());
					final String desc = CurrentLocale.get(ext.getParameter("description").valueAsString());

					predefinedTermDataKeys.put(key, new Pair<String, String>(name, desc));
				}
			}
			return valid;
		}

		@Override
		public void finished()
		{
			if( !get() )
			{
				return;
			}

			final JPanel p = InternalDataSourceTab.this;

			// Remove this listener and clear the panel
			p.removeComponentListener(ensureTaxonomySavedListener);
			p.removeAll();

			final RemoteTermService termService = clientService.getService(RemoteTermService.class);

			tree = new AbstractTreeEditor<TermTreeNode>()
			{
				@Override
				protected AbstractTreeEditorTree<TermTreeNode> createTree()
				{
					return new TermTree(taxonomy, true, termService);
				}

				@Override
				protected AbstractTreeNodeEditor createEditor(TermTreeNode node)
				{
					return new TermEditor(termService, predefinedTermDataKeys, taxonomy, node);
				}
			};

			p.setLayout(new MigLayout("wrap 1, fill"));
			p.add(new JLabel("<html>" + s("immediatechanges")));
			p.add(tree, "push, grow");

			p.revalidate();
			p.repaint();
		}
	};
	worker.setComponent(InternalDataSourceTab.this);
	worker.start();
}
 
开发者ID:equella,项目名称:Equella,代码行数:75,代码来源:InternalDataSourceTab.java


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