javax.swing.JLabel.getMaximumSize()方法的使用及代码示例

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

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

JLabel.getMaximumSize介绍

暂无

代码示例

代码示例来源:origin: pentaho/mondrian

tableW = Math.max(
    tableW, comp.getPreferredSize().width + stringRenderer
      .getMaximumSize().width);
} else if (value == null) {
  tableH += stringRenderer.getMaximumSize().height;
  tableW = Math.max(
    tableW, stringRenderer.getMaximumSize().width * 2);
} else {
  tableH += height;

代码示例来源:origin: pentaho/mondrian

listRenderer.setMaximumSize(stringRenderer.getMaximumSize());
listRenderer.setFont(Font.decode("Dialog"));
listRenderer.setBackground(Color.white);

代码示例来源:origin: org.codehaus.jtstand/jtstand-desktop

@Override
public Dimension getMaximumSize() {
  Dimension dim = super.getMaximumSize();
  dim.width = Integer.MAX_VALUE;
  dim.height = Integer.MAX_VALUE;
  return dim;
}

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core

@Override
public Dimension getMaximumSize() {
  Dimension dim = super.getMaximumSize();
  dim.width = Integer.MAX_VALUE;
  dim.height = Integer.MAX_VALUE;
  return dim;
}

代码示例来源:origin: com.haulmont.thirdparty/swingx-core

@Override
public Dimension getMaximumSize() {
  Dimension dim = super.getMaximumSize();
  dim.width = Integer.MAX_VALUE;
  dim.height = Integer.MAX_VALUE;
  return dim;
}

代码示例来源:origin: org.swinglabs.swingx/swingx-core

@Override
public Dimension getMaximumSize() {
  Dimension dim = super.getMaximumSize();
  dim.width = Integer.MAX_VALUE;
  dim.height = Integer.MAX_VALUE;
  return dim;
}

代码示例来源:origin: org.ihtsdo/wb-api

@Override
public Dimension getMaximumSize() {
  if (lineWrapEnabled) {
    return wrapSize;
  }
  return super.getMaximumSize();
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/skinlf

/**
 * Gets the MaximumSize attribute of the SkinDesktopIconUI object
 *
 * @param c  Description of Parameter
 * @return   The MaximumSize value
 */
public Dimension getMaximumSize(JComponent c) {
 return iconPane.getMaximumSize();
}

代码示例来源:origin: org.swinglabs.swingx/swingx-all

@Override
public Dimension getMaximumSize() {
  Dimension dim = super.getMaximumSize();
  dim.width = Integer.MAX_VALUE;
  dim.height = Integer.MAX_VALUE;
  return dim;
}

代码示例来源:origin: org.bidib.jbidib.com.vldocking/vldocking

public Dimension getMaximumSize() {
  if(zone == DockingConstants.INT_HIDE_TOP || zone == DockingConstants.INT_HIDE_BOTTOM) {
    return super.getMaximumSize();
  } else {
    Insets i = getInsets();
    Dimension d = super.getMaximumSize();
    return new Dimension(d.height - i.top - i.bottom + i.left + i.right, d.width - i.left - i.right + i.top + i.bottom); // rotate the shape
  }
}

代码示例来源:origin: RPTools/maptool

public Dimension getMaximumSize() {
  Dimension d = super.getMaximumSize();
  if (isRotated()) {
    int width = d.width;
    d.width = d.height + 10;
    d.height = width + 10;
  }
  return d;
}

代码示例来源:origin: org.apache.poi/poi-examples

@Override
public Dimension getMaximumSize() {
 Dimension d = super.getMaximumSize();
 if (row >= 0) {
  d.height = getRowHeight(row);
 }
 return d;
}

代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu

public Dimension getMaximumSize()
{
 if((delegate_==this)||(delegate_==null))
  return super.getMaximumSize();
 return delegate_.getMaximumSize();
}

代码示例来源:origin: com.jidesoft/jide-oss

@Override
public Dimension getMaximumSize() {
  return isLineWrap() ? new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE) : super.getMaximumSize();
}

代码示例来源:origin: net.sf.ingenias/editor

@Override
public Dimension getMaximumSize() {
  if (getText().length()==0 && getIcon()==null)
    return new Dimension(0,0);
  else
    return super.getMaximumSize();
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

public Dimension getMaximumSize() {
  Dimension result = super.getMaximumSize();
  result.height = getParent().getHeight();            
  return result;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

public Dimension getMaximumSize() {
  Dimension result = super.getMaximumSize();
  result.height = getParent().getHeight();            
  return result;
}

代码示例来源:origin: nroduit/Weasis

public void updateSize(int thumbnailSize) {
  Dimension max = label.getMaximumSize();
  if (max == null || max.width != thumbnailSize) {
    if (sequence instanceof Series) {
      Series series = (Series) sequence;
      SeriesThumbnail thumb = (SeriesThumbnail) series.getTagValue(TagW.Thumbnail);
      if (thumb != null) {
        thumb.setThumbnailSize(thumbnailSize);
      }
    }
    FontRenderContext frc = new FontRenderContext(null, false, false);
    Dimension dim =
      new Dimension(thumbnailSize, (int) (label.getFont().getStringBounds("0", frc).getHeight() + 1.0f)); //$NON-NLS-1$
    label.setPreferredSize(dim);
    label.setMaximumSize(dim);
  }
}

代码示例来源:origin: triplea-game/triplea

@Test
 public void maxSize() {
  final int maxWidth = 300;
  final int maxHeight = 500;
  final JLabel label = JLabelBuilder.builder()
    .text("testing")
    .maximumSize(maxWidth, maxHeight)
    .build();

  MatcherAssert.assertThat(label.getMaximumSize().width, is(maxWidth));
  MatcherAssert.assertThat(label.getMaximumSize().height, is(maxHeight));
 }
}

代码示例来源:origin: com.bbossgroups/bboss-htmlparser

/**
 * Create a filter.
 * Set up the default display.
 * Only a border with the label of the filter name,
 * returned by <code>getDescription()</code>,
 * and an icon, returned by <code>getIcon()</code>.
 */
public Filter ()
{
  JLabel label;
  Dimension dimension;
  Insets insets;
  setToolTipText (getDescription ());
  // none of these quite does it:
  // new BoxLayout (this, BoxLayout.Y_AXIS));
  // new GridLayout (0, 1));
  setLayout (new VerticalLayoutManager ());
  setSelected (false);
  label = new JLabel (getDescription (), getIcon (), SwingConstants.LEFT);
  label.setBackground (Color.green);
  label.setAlignmentX (Component.LEFT_ALIGNMENT);
  label.setHorizontalAlignment (SwingConstants.LEFT);
  add (label);
  dimension = label.getMaximumSize ();
  insets = getInsets ();
  dimension.setSize (dimension.width + insets.left + insets.right, dimension.height + insets.top + insets.bottom);
  setSize (dimension);
}

相关文章

JLabel类方法