本文整理了Java中javax.swing.JToolBar.revalidate()
方法的一些代码示例,展示了JToolBar.revalidate()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JToolBar.revalidate()
方法的具体详情如下:
包路径:javax.swing.JToolBar
类名称:JToolBar
方法名:revalidate
暂无
代码示例来源:origin: stanfordnlp/CoreNLP
private void buildTagPanel() {
if (tagPanel == null) {
tagPanel = new JToolBar(SwingConstants.VERTICAL);
tagPanel.setFloatable(false);
frame.getContentPane().add(tagPanel, BorderLayout.EAST);
} else {
tagPanel.removeAll();
}
if (classifier != null) {
makeTagMaps();
Set<String> tags = classifier.labels();
String backgroundSymbol = classifier.backgroundSymbol();
for (String tag : tags) {
if (backgroundSymbol.equals(tag)) { continue; }
Color color = tagToColorMap.get(tag);
JButton b = new JButton(tag, new ColorIcon(color));
tagPanel.add(b);
}
}
tagPanel.revalidate();
tagPanel.repaint();
}
代码示例来源:origin: stanfordnlp/CoreNLP
private void buildTagPanel() {
if (tagPanel == null) {
tagPanel = new JToolBar(SwingConstants.VERTICAL);
tagPanel.setFloatable(false);
frame.getContentPane().add(tagPanel, BorderLayout.EAST);
} else {
tagPanel.removeAll();
}
if (classifier != null) {
makeTagMaps();
Set<String> tags = classifier.labels();
String backgroundSymbol = classifier.backgroundSymbol();
for (String tag : tags) {
if (backgroundSymbol.equals(tag)) { continue; }
Color color = tagToColorMap.get(tag);
JButton b = new JButton(tag, new ColorIcon(color));
tagPanel.add(b);
}
}
tagPanel.revalidate();
tagPanel.repaint();
}
代码示例来源:origin: jshiell/checkstyle-idea
/**
* Show and reset the progress bar.
*/
private void resetProgressBar() {
progressBar.setValue(0);
// show if necessary
if (progressPanel.getComponentIndex(progressBar) == -1) {
progressPanel.add(progressBar);
}
progressPanel.revalidate();
}
代码示例来源:origin: jshiell/checkstyle-idea
private void clearProgress() {
final int progressIndex = progressPanel.getComponentIndex(progressBar);
if (progressIndex != -1) {
progressPanel.remove(progressIndex);
progressPanel.revalidate();
progressPanel.repaint();
}
setProgressText(null);
}
代码示例来源:origin: org.boofcv/visualize
/**
* Adds a new component into the toolbar.
*
* @param comp The component being added
*/
public void addToToolbar( JComponent comp ) {
toolbar.add(comp,1+algBoxes.length);
toolbar.revalidate();
addedComponents.add(comp);
}
代码示例来源:origin: org.boofcv/boofcv-swing
/**
* Adds a new component into the toolbar.
*
* @param comp The component being added
*/
public void addToToolbar( JComponent comp ) {
toolbar.add(comp,1+algBoxes.length);
toolbar.revalidate();
addedComponents.add(comp);
}
代码示例来源:origin: us.ihmc/ImageProcessing
/**
* Adds a new component into the toolbar.
*
* @param comp The component being added
*/
public void addToToolbar( JComponent comp ) {
toolbar.add(comp,1+algBoxes.length);
toolbar.revalidate();
addedComponents.add(comp);
}
代码示例来源:origin: org.boofcv/visualize
public void removeFromToolbar( JComponent comp ) {
toolbar.remove(comp);
toolbar.revalidate();
addedComponents.remove(comp);
}
代码示例来源:origin: org.boofcv/boofcv-swing
public void removeFromToolbar( JComponent comp ) {
toolbar.remove(comp);
toolbar.revalidate();
addedComponents.remove(comp);
}
代码示例来源:origin: com.jtattoo/JTattoo
protected void updateToolbarBorder() {
toolBar.revalidate();
toolBar.repaint();
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction(jsDoc = ADD_JSDOC, params = {"component"})
public void add(JComponent aComp) {
if (aComp != null) {
super.add(aComp);
super.revalidate();
super.repaint();
}
}
代码示例来源:origin: nz.ac.waikato.cms.weka/weka-stable
@Override
public void mouseClicked(MouseEvent e) {
super.mouseClicked(e);
m_browserTools.remove(m_newPackagesAvailableL);
m_browserTools.revalidate();
}
});
代码示例来源:origin: Waikato/weka-trunk
@Override
public void mouseClicked(MouseEvent e) {
super.mouseClicked(e);
m_browserTools.remove(m_newPackagesAvailableL);
m_browserTools.revalidate();
}
});
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction(jsDoc = CLEAR_JSDOC)
@Override
public void clear() {
super.removeAll();
super.revalidate();
super.repaint();
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction(jsDoc = REMOVE_JSDOC, params = {"component"})
@Override
public void remove(JComponent aComp) {
super.remove(aComp);
super.revalidate();
super.repaint();
}
代码示例来源:origin: hneemann/Digital
/**
* Updates all custom components.
* If the component no longer exists, it is deleted from the history toolbar.
*/
private void updateCustomComponents() {
Iterator<WrapperAction> it = wrappers.iterator();
while (it.hasNext()) {
WrapperAction w = it.next();
if (w.action.isCustom()) {
LibraryNode n = library.getElementNodeOrNull(w.action.getName());
if (n == null) { // is'nt there, so delete
removeWrapperFromToolBar(w);
it.remove();
} else
w.update(n);
}
}
bar.revalidate();
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-terminal-nb
private void setButtons(Action[] actions) {
if (actions == null)
actions = new Action[0];
JButton[] buttons = new JButton[actions.length];
for (int ax = 0; ax < actions.length; ax++) {
Action a = actions[ax];
JButton b = new JButton(a);
buttons[ax] = adjustButton(b);
}
actionBar.removeAll();
if (buttons.length != 0) {
actionBar.setVisible(true);
for (JButton b : buttons) {
actionBar.add(b);
}
} else {
actionBar.setVisible(false);
}
actionBar.revalidate();
actionBar.repaint();
}
代码示例来源:origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun
public void removeToolBarComponent(Component c) {
if (c != null) {
getToolBar().remove(c);
getToolBar().revalidate();
getToolBar().repaint();
}
}
代码示例来源:origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun
public void removeToolBarAction(Action action) {
if (action != null) {
Component found = null;
for (Component c : getToolBar().getComponents()) {
if (c instanceof AbstractButton) {
AbstractButton btn = (AbstractButton) c;
if (action.equals(btn.getAction())) {
found = c;
break;
}
}
}
if (found != null) {
getToolBar().remove(found);
getToolBar().revalidate();
getToolBar().repaint();
}
}
}
代码示例来源:origin: vasl-developers/vasl
private void ToolbarMove()
{
if (m_enToolbarPosition == ToolBarPosition.TP_EAST)
{
m_enToolbarPosition = ToolBarPosition.TP_WEST;
SwingUtilities.getWindowAncestor(m_objASLMap.getLayeredPane()).getLayout().removeLayoutComponent(m_Toolbar);
SwingUtilities.getWindowAncestor(m_objASLMap.getLayeredPane()).add(m_Toolbar, BorderLayout.WEST);
}
else
{
m_enToolbarPosition = ToolBarPosition.TP_EAST;
SwingUtilities.getWindowAncestor(m_objASLMap.getLayeredPane()).getLayout().removeLayoutComponent(m_Toolbar);
SwingUtilities.getWindowAncestor(m_objASLMap.getLayeredPane()).add(m_Toolbar, BorderLayout.EAST);
}
saveToolbarPos();
m_objASLMap.getView().revalidate();
m_Toolbar.revalidate();
NeedRepaint();
}
内容来源于网络,如有侵权,请联系作者删除!