javax.swing.JToggleButton.putClientProperty()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(10.7k)|赞(0)|评价(0)|浏览(104)

本文整理了Java中javax.swing.JToggleButton.putClientProperty()方法的一些代码示例,展示了JToggleButton.putClientProperty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JToggleButton.putClientProperty()方法的具体详情如下:
包路径:javax.swing.JToggleButton
类名称:JToggleButton
方法名:putClientProperty

JToggleButton.putClientProperty介绍

暂无

代码示例

代码示例来源:origin: org.codehaus.groovy/groovy

tokenButton.addActionListener(this);
tokenButton.setToolTipText(token.getText());
tokenButton.putClientProperty("token", token);
tokenButton.setMargin(new Insets(0, 1, 0, 1));
tokenButton.setFocusPainted(false);

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

public static JToggleButton getMenuToggleButton(String title) { //, int num) {
  JToggleButton button = new JToggleButton(title);
  if (MiscUtils.MAC) {
    button.putClientProperty("JButton.buttonType", "textured");
  }
  return button;
}

代码示例来源:origin: io.ultreia.java4all.jaxx/jaxx-widgets-gis

protected void addChildrenToQuadrant2() {
  { ButtonGroup $buttonGroup = quadrantBG; quadrant2.putClientProperty("$buttonGroup", $buttonGroup); $buttonGroup.add(quadrant2); }
}

代码示例来源:origin: io.ultreia.java4all.jaxx/jaxx-widgets-gis

protected void addChildrenToQuadrant3() {
  { ButtonGroup $buttonGroup = quadrantBG; quadrant3.putClientProperty("$buttonGroup", $buttonGroup); $buttonGroup.add(quadrant3); }
}

代码示例来源:origin: io.ultreia.java4all.jaxx/jaxx-widgets-gis

protected void addChildrenToQuadrant4() {
  { ButtonGroup $buttonGroup = quadrantBG; quadrant4.putClientProperty("$buttonGroup", $buttonGroup); $buttonGroup.add(quadrant4); }
}

代码示例来源:origin: io.ultreia.java4all.jaxx/jaxx-widgets-gis

protected void addChildrenToQuadrant1() {
  { ButtonGroup $buttonGroup = quadrantBG; quadrant1.putClientProperty("$buttonGroup", $buttonGroup); $buttonGroup.add(quadrant1); }
}

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

public static JToggleButton getSoftToggleButton(String string) {
  JToggleButton b = new JToggleButton(string);
  b.setFocusable(false);
  b.putClientProperty("JButton.buttonType", "segmentedRoundRect");
  b.putClientProperty("JButton.segmentPosition", "only");
  return b;
}

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

public static JToggleButton getTexturedToggleButton(String s) {
  JToggleButton button = new JToggleButton(s);
  button.setFocusable(false);
  button.putClientProperty("JButton.buttonType", "textured");
  return button;
}

代码示例来源:origin: jsettlers/settlers-remake

private void registerMenu(String translationKey, ActionListener listener) {
  JToggleButton bt = new JToggleButton(Labels.getString(translationKey));
  bt.putClientProperty(ELFStyle.KEY, ELFStyle.BUTTON_MENU);
  buttonGroup.add(bt);
  bt.addActionListener(listener);
  buttonPanel.add(bt);
  bt.setPreferredSize(new Dimension(230, 60));
}

代码示例来源:origin: edu.toronto.cs.medsavant/medsavant-client

public static JToggleButton getTexturedToggleButton(ImageIcon icon) {
  JToggleButton button = new JToggleButton(icon);
  button.setFocusable(false);
  ViewUtil.makeSmall(button);
  button.putClientProperty("JButton.buttonType", "textured");
  return button;
}

代码示例来源:origin: jsettlers/settlers-remake

/**
 * Initialize the filter buttons
 */
private void initFilter() {
  JLabel filterLabel = new JLabel(Labels.getString("mapfilter.title"));
  filterLabel.putClientProperty(ELFStyle.KEY, ELFStyle.LABEL_SHORT);
  filterPanel.add(filterLabel);
  boolean first = true;
  ButtonGroup group = new ButtonGroup();
  for (final EMapFilter filter : EMapFilter.values()) {
    JToggleButton bt = new JToggleButton(filter.getName());
    bt.putClientProperty(ELFStyle.KEY, ELFStyle.TOGGLE_BUTTON_STONE);
    bt.addActionListener(e -> {
      currentFilter = filter;
      searchChanged();
    });
    if (first) {
      first = false;
      bt.setSelected(true);
    }
    group.add(bt);
    filterPanel.add(bt);
  }
}

代码示例来源:origin: com.thinkaurelius.groovy-shaded-asm/groovy-shaded-asm

private void scanScript(File file) throws Exception{
  scriptPane.read(new FileReader(file), null);
  // create lexer
  Constructor constructor = lexerClass.getConstructor(new Class[]{InputStream.class});
  CharScanner lexer = (CharScanner) constructor.newInstance(new Object[]{new FileInputStream(file)});
  tokenPane.setEditable(true);
  tokenPane.setText("");
  int line = 1;
  ButtonGroup bg = new ButtonGroup();
  Token token = null;
  while(true){
    token = lexer.nextToken();
    JToggleButton tokenButton = new JToggleButton((String) tokens.get(Integer.valueOf(token.getType())));
    bg.add(tokenButton);
    tokenButton.addActionListener(this);
    tokenButton.setToolTipText(token.getText());
    tokenButton.putClientProperty("token", token);
    tokenButton.setMargin(new Insets(0, 1, 0, 1));
    tokenButton.setFocusPainted(false);
    if(token.getLine()>line){
      tokenPane.getDocument().insertString(tokenPane.getDocument().getLength(), "\n", null);
      line = token.getLine();
    }
    insertComponent(tokenButton);
    if(token.getType()==Token.EOF_TYPE)
      break;
  }
  tokenPane.setEditable(false);
  tokenPane.setCaretPosition(0);
}

代码示例来源:origin: org.codehaus.groovy/groovy-all-minimal

private void scanScript(File file) throws Exception{
  scriptPane.read(new FileReader(file), null);
  // create lexer
  Constructor constructor = lexerClass.getConstructor(new Class[]{InputStream.class});
  CharScanner lexer = (CharScanner) constructor.newInstance(new Object[]{new FileInputStream(file)});
  tokenPane.setEditable(true);
  tokenPane.setText("");
  int line = 1;
  ButtonGroup bg = new ButtonGroup();
  Token token = null;
  while(true){
    token = lexer.nextToken();
    JToggleButton tokenButton = new JToggleButton((String) tokens.get(new Integer(token.getType())));
    bg.add(tokenButton);
    tokenButton.addActionListener(this);
    tokenButton.setToolTipText(token.getText());
    tokenButton.putClientProperty("token", token);
    tokenButton.setMargin(new Insets(0, 1, 0, 1));
    tokenButton.setFocusPainted(false);
    if(token.getLine()>line){
      tokenPane.getDocument().insertString(tokenPane.getDocument().getLength(), "\n", null);
      line = token.getLine();
    }
    insertComponent(tokenButton);
    if(token.getType()==Token.EOF_TYPE)
      break;
  }
  tokenPane.setEditable(false);
  tokenPane.setCaretPosition(0);
}

代码示例来源:origin: org.bitbucket.goalhub.simpleide/jedit

public void register(DockableWindowManagerImpl.Entry entry)
{
  dockables.add(entry);
  //{{{ Create button
  int rotation;
  if(position.equals(DockableWindowManagerImpl.TOP)
    || position.equals(DockableWindowManagerImpl.BOTTOM))
    rotation = RotatedTextIcon.NONE;
  else if(position.equals(DockableWindowManagerImpl.LEFT))
    rotation = RotatedTextIcon.CCW;
  else if(position.equals(DockableWindowManagerImpl.RIGHT))
    rotation = RotatedTextIcon.CW;
  else
    throw new InternalError("Invalid position: " + position);
  JToggleButton button = new JToggleButton();
  button.setMargin(new Insets(1,1,1,1));
  button.setRequestFocusEnabled(false);
  button.setIcon(new RotatedTextIcon(rotation,button.getFont(),
    entry.shortTitle()));
  button.setActionCommand(entry.factory.name);
  button.addActionListener(new ActionHandler());
  button.addMouseListener(new MenuMouseHandler());
  if(OperatingSystem.isMacOSLF())
    button.putClientProperty("JButton.buttonType","toolbar");
  //}}}
  buttonGroup.add(button);
  buttons.add(button);
  entry.btn = button;
  wm.revalidate();
} //}}}

代码示例来源:origin: org.kohsuke.droovy/groovy

private void scanScript(File file) throws Exception{
  scriptPane.read(new FileReader(file), null);
  // create lexer
  Constructor constructor = lexerClass.getConstructor(new Class[]{InputStream.class});
  CharScanner lexer = (CharScanner) constructor.newInstance(new Object[]{new FileInputStream(file)});
  tokenPane.setEditable(true);
  tokenPane.setText("");
  int line = 1;
  ButtonGroup bg = new ButtonGroup();
  Token token = null;
  while(true){
    token = lexer.nextToken();
    JToggleButton tokenButton = new JToggleButton((String) tokens.get(Integer.valueOf(token.getType())));
    bg.add(tokenButton);
    tokenButton.addActionListener(this);
    tokenButton.setToolTipText(token.getText());
    tokenButton.putClientProperty("token", token);
    tokenButton.setMargin(new Insets(0, 1, 0, 1));
    tokenButton.setFocusPainted(false);
    if(token.getLine()>line){
      tokenPane.getDocument().insertString(tokenPane.getDocument().getLength(), "\n", null);
      line = token.getLine();
    }
    insertComponent(tokenButton);
    if(token.getType()==Token.EOF_TYPE)
      break;
  }
  tokenPane.setEditable(false);
  tokenPane.setCaretPosition(0);
}

代码示例来源:origin: org.java.net.substance/substance

tb.setVerticalTextPosition(SwingConstants.BOTTOM);
tb.setFont(UIManager.getFont("ColorChooser.font"));
tb.putClientProperty("Quaqua.Button.style", "toolBarTab");
JPanel centerView = new JPanel(new BorderLayout());
centerView.add(ccp);

代码示例来源:origin: org.codehaus.groovy/groovy-jdk14

private void scanScript(File file) throws Exception{
  scriptPane.read(new FileReader(file), null);
  // create lexer
  Constructor constructor = lexerClass.getConstructor(new Class[]{InputStream.class});
  CharScanner lexer = (CharScanner) constructor.newInstance(new Object[]{new FileInputStream(file)});
  tokenPane.setEditable(true);
  tokenPane.setText("");
  int line = 1;
  ButtonGroup bg = new ButtonGroup();
  Token token = null;
  while(true){
    token = lexer.nextToken();
    JToggleButton tokenButton = new JToggleButton((String) tokens.get(Integer.valueOf(token.getType())));
    bg.add(tokenButton);
    tokenButton.addActionListener(this);
    tokenButton.setToolTipText(token.getText());
    tokenButton.putClientProperty("token", token);
    tokenButton.setMargin(new Insets(0, 1, 0, 1));
    tokenButton.setFocusPainted(false);
    if(token.getLine()>line){
      tokenPane.getDocument().insertString(tokenPane.getDocument().getLength(), "\n", null);
      line = token.getLine();
    }
    insertComponent(tokenButton);
    if(token.getType()==Token.EOF_TYPE)
      break;
  }
  tokenPane.setEditable(false);
  tokenPane.setCaretPosition(0);
}

代码示例来源:origin: de.sciss/prefuse-core

m_group.add(tb);
tb.putClientProperty("idx", new Integer(i));
tb.addActionListener(m_lstnr);
add(tb);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-remotefs-versioning-api

tgb.setSelected(filter.isSelected());
tgb.addActionListener(this);                
tgb.putClientProperty(TOOLBAR_FILTER, filter);
bg.add(tgb);
toolbar.add(tgb);

代码示例来源:origin: io.ultreia.java4all.jaxx/jaxx-widgets-gis

{ quadrant4.putClientProperty("$value", new Integer(4));  Object $buttonGroup = quadrant4.getClientProperty("$buttonGroup"); if ($buttonGroup instanceof JAXXButtonGroup) { ((JAXXButtonGroup) $buttonGroup).updateSelectedValue(); } }
{ quadrant1.putClientProperty("$value", new Integer(1));  Object $buttonGroup = quadrant1.getClientProperty("$buttonGroup"); if ($buttonGroup instanceof JAXXButtonGroup) { ((JAXXButtonGroup) $buttonGroup).updateSelectedValue(); } }
{ quadrant3.putClientProperty("$value", new Integer(3));  Object $buttonGroup = quadrant3.getClientProperty("$buttonGroup"); if ($buttonGroup instanceof JAXXButtonGroup) { ((JAXXButtonGroup) $buttonGroup).updateSelectedValue(); } }
{ quadrant2.putClientProperty("$value", new Integer(2));  Object $buttonGroup = quadrant2.getClientProperty("$buttonGroup"); if ($buttonGroup instanceof JAXXButtonGroup) { ((JAXXButtonGroup) $buttonGroup).updateSelectedValue(); } }

相关文章

JToggleButton类方法