congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
RefineryUtilities
Code IndexAdd Tabnine to your IDE (free)

How to use
RefineryUtilities
in
org.jfree.ui

Best Java code snippets using org.jfree.ui.RefineryUtilities (Showing top 20 results out of 315)

origin: com.github.chen0040/java-data-visualizer

public void showIt(boolean centered) {
 if(centered) {
   RefineryUtilities.centerFrameOnScreen(this);
 }
 showIt();
}
origin: org.ow2.jasmine/mbeancmd-core

/**
 * Shows / updates the displayed graph.
 */
public void showMe() {
  boolean shown;
  synchronized(this) {
    shown = isShown;
    if (!isShown) {
      isShown = true;
    }
  }
  if(!shown) {
    this.pack();
    RefineryUtilities.centerFrameOnScreen(this);
    RefineryUtilities.positionFrameRandomly(this);
    RefineryUtilities.positionFrameOnScreen(this, 1, 0);
    this.setVisible(true);
  }
}
origin: jfree/jcommon

/**
 * Positions the specified dialog within its parent.
 *
 * @param dialog  the dialog to be positioned on the screen.
 */
public static void centerDialogInParent(final Dialog dialog) {
  positionDialogRelativeToParent(dialog, 0.5, 0.5);
}
origin: jfree/jcommon

/**
 * Positions the specified frame in the middle of the screen.
 *
 * @param frame  the frame to be centered on the screen.
 */
public static void centerFrameOnScreen(final Window frame) {
  positionFrameOnScreen(frame, 0.5, 0.5);
}
origin: jfree/jcommon

final JLabel appLabel = RefineryUtilities.createJLabel(application, f1, Color.black);
appLabel.setHorizontalTextPosition(SwingConstants.CENTER);
appPanel.add(appLabel);
final JLabel verLabel = RefineryUtilities.createJLabel(version, f2, Color.black);
verLabel.setHorizontalTextPosition(SwingConstants.CENTER);
verPanel.add(verLabel);
final JLabel copyrightLabel = RefineryUtilities.createJLabel(copyright, f2, Color.black);
copyrightLabel.setHorizontalTextPosition(SwingConstants.CENTER);
copyrightPanel.add(copyrightLabel);
final JLabel infoLabel = RefineryUtilities.createJLabel(info, f2, Color.black);
infoLabel.setHorizontalTextPosition(SwingConstants.CENTER);
infoPanel.add(infoLabel);
origin: org.jfree/com.springsource.org.jfree

/**
 * Positions the specified frame at a relative position in the screen, where 50% is considered
 * to be the center of the screen.
 *
 * @param frame  the frame.
 * @param horizontalPercent  the relative horizontal position of the frame (0.0 to 1.0,
 *                           where 0.5 is the center of the screen).
 * @param verticalPercent  the relative vertical position of the frame (0.0 to 1.0, where
 *                         0.5 is the center of the screen).
 */
public static void positionFrameOnScreen(final Window frame,
                     final double horizontalPercent,
                     final double verticalPercent) {
  final Rectangle s = getMaximumWindowBounds();
  final Dimension f = frame.getSize();
  final int w = Math.max(s.width - f.width, 0);
  final int h = Math.max(s.height - f.height, 0);
  final int x = (int) (horizontalPercent * w) + s.x;
  final int y = (int) (verticalPercent * h) + s.y;
  frame.setBounds(x, y, f.width, f.height);
}
origin: org.jfree/jcommon

/**
 * Positions the specified frame in the middle of the screen.
 *
 * @param frame  the frame to be centered on the screen.
 */
public static void centerFrameOnScreen(final Window frame) {
  positionFrameOnScreen(frame, 0.5, 0.5);
}
origin: org.jfree/jcommon

final JLabel appLabel = RefineryUtilities.createJLabel(application, f1, Color.black);
appLabel.setHorizontalTextPosition(SwingConstants.CENTER);
appPanel.add(appLabel);
final JLabel verLabel = RefineryUtilities.createJLabel(version, f2, Color.black);
verLabel.setHorizontalTextPosition(SwingConstants.CENTER);
verPanel.add(verLabel);
final JLabel copyrightLabel = RefineryUtilities.createJLabel(copyright, f2, Color.black);
copyrightLabel.setHorizontalTextPosition(SwingConstants.CENTER);
copyrightPanel.add(copyrightLabel);
final JLabel infoLabel = RefineryUtilities.createJLabel(info, f2, Color.black);
infoLabel.setHorizontalTextPosition(SwingConstants.CENTER);
infoPanel.add(infoLabel);
origin: jfree/jcommon

/**
 * Positions the specified frame at a relative position in the screen, where 50% is considered
 * to be the center of the screen.
 *
 * @param frame  the frame.
 * @param horizontalPercent  the relative horizontal position of the frame (0.0 to 1.0,
 *                           where 0.5 is the center of the screen).
 * @param verticalPercent  the relative vertical position of the frame (0.0 to 1.0, where
 *                         0.5 is the center of the screen).
 */
public static void positionFrameOnScreen(final Window frame,
                     final double horizontalPercent,
                     final double verticalPercent) {
  final Rectangle s = getMaximumWindowBounds();
  final Dimension f = frame.getSize();
  final int w = Math.max(s.width - f.width, 0);
  final int h = Math.max(s.height - f.height, 0);
  final int x = (int) (horizontalPercent * w) + s.x;
  final int y = (int) (verticalPercent * h) + s.y;
  frame.setBounds(x, y, f.width, f.height);
}
origin: com.github.chen0040/java-data-visualizer

public void showIt(boolean centered) {
 if(centered) {
   RefineryUtilities.centerFrameOnScreen(this);
 }
 showIt();
}
origin: org.ow2.jasmine/mbeancmd-core

RefineryUtilities.centerFrameOnScreen(demo);
RefineryUtilities.positionFrameRandomly(demo);
RefineryUtilities.positionFrameOnScreen(demo, 1, 0);
if (visible) {
  demo.setVisible(true);
origin: org.jfree/com.springsource.org.jfree

/**
 * Positions the specified frame in the middle of the screen.
 *
 * @param frame  the frame to be centered on the screen.
 */
public static void centerFrameOnScreen(final Window frame) {
  positionFrameOnScreen(frame, 0.5, 0.5);
}
origin: org.jfree/com.springsource.org.jfree

/**
 * Positions the specified dialog within its parent.
 *
 * @param dialog  the dialog to be positioned on the screen.
 */
public static void centerDialogInParent(final Dialog dialog) {
  positionDialogRelativeToParent(dialog, 0.5, 0.5);
}
origin: org.jfree/com.springsource.org.jfree

final JLabel appLabel = RefineryUtilities.createJLabel(application, f1, Color.black);
appLabel.setHorizontalTextPosition(SwingConstants.CENTER);
appPanel.add(appLabel);
final JLabel verLabel = RefineryUtilities.createJLabel(version, f2, Color.black);
verLabel.setHorizontalTextPosition(SwingConstants.CENTER);
verPanel.add(verLabel);
final JLabel copyrightLabel = RefineryUtilities.createJLabel(copyright, f2, Color.black);
copyrightLabel.setHorizontalTextPosition(SwingConstants.CENTER);
copyrightPanel.add(copyrightLabel);
final JLabel infoLabel = RefineryUtilities.createJLabel(info, f2, Color.black);
infoLabel.setHorizontalTextPosition(SwingConstants.CENTER);
infoPanel.add(infoLabel);
origin: org.jfree/com.springsource.org.jfree

/**
 * Positions the specified dialog at a position relative to its parent.
 *
 * @param dialog  the dialog to be positioned.
 * @param horizontalPercent  the relative location.
 * @param verticalPercent  the relative location.
 */
public static void positionDialogRelativeToParent(final Dialog dialog,
                         final double horizontalPercent,
                         final double verticalPercent) {
  final Dimension d = dialog.getSize();
  final Container parent = dialog.getParent();
  final Dimension p = parent.getSize();
  final int baseX = parent.getX() - d.width;
  final int baseY = parent.getY() - d.height;
  final int w = d.width + p.width;
  final int h = d.height + p.height;
  int x = baseX + (int) (horizontalPercent * w);
  int y = baseY + (int) (verticalPercent * h);
  // make sure the dialog fits completely on the screen...
  final Rectangle s = getMaximumWindowBounds();
  x = Math.min(x, (s.width - d.width));
  x = Math.max(x, 0);
  y = Math.min(y, (s.height - d.height));
  y = Math.max(y, 0);
  dialog.setBounds(x + s.x, y + s.y, d.width, d.height);
}
origin: com.github.chen0040/java-data-visualizer

  public static void main(String[] args) {
   List<Double> costTrends = Arrays.asList(1.0, 1.2, 1.3, 1.34, 1.23, 1.11, 1.5);
   CostTrend chart = new CostTrend(costTrends, "cost vs generation");

   RefineryUtilities.centerFrameOnScreen( chart );
   chart.showIt(true);
  }
}
origin: org.jfree/com.springsource.org.jfree

/**
 * Positions the specified frame at a random location on the screen while ensuring that the
 * entire frame is visible (provided that the frame is smaller than the screen).
 *
 * @param frame  the frame.
 */
public static void positionFrameRandomly(final Window frame) {
  positionFrameOnScreen(frame, Math.random(), Math.random());
}
origin: org.jfree/jcommon

/**
 * Positions the specified dialog within its parent.
 *
 * @param dialog  the dialog to be positioned on the screen.
 */
public static void centerDialogInParent(final Dialog dialog) {
  positionDialogRelativeToParent(dialog, 0.5, 0.5);
}
origin: jfree/jcommon

/**
 * Positions the specified dialog at a position relative to its parent.
 *
 * @param dialog  the dialog to be positioned.
 * @param horizontalPercent  the relative location.
 * @param verticalPercent  the relative location.
 */
public static void positionDialogRelativeToParent(final Dialog dialog,
                         final double horizontalPercent,
                         final double verticalPercent) {
  final Dimension d = dialog.getSize();
  final Container parent = dialog.getParent();
  final Dimension p = parent.getSize();
  final int baseX = parent.getX() - d.width;
  final int baseY = parent.getY() - d.height;
  final int w = d.width + p.width;
  final int h = d.height + p.height;
  int x = baseX + (int) (horizontalPercent * w);
  int y = baseY + (int) (verticalPercent * h);
  // make sure the dialog fits completely on the screen...
  final Rectangle s = getMaximumWindowBounds();
  x = Math.min(x, (s.width - d.width));
  x = Math.max(x, 0);
  y = Math.min(y, (s.height - d.height));
  y = Math.max(y, 0);
  dialog.setBounds(x + s.x, y + s.y, d.width, d.height);
}
origin: net.sf.phat/phat-devices

public void showWindow() {
  pack();        
  RefineryUtilities.centerFrameOnScreen(this);
  setVisible(true);
}
org.jfree.uiRefineryUtilities

Javadoc

A collection of utility methods relating to user interfaces.

Most used methods

  • centerFrameOnScreen
    Positions the specified frame in the middle of the screen.
  • positionFrameOnScreen
    Positions the specified frame at a relative position in the screen, where 50% is considered to be th
  • createJLabel
    Creates a label with a specific font and color.
  • positionDialogRelativeToParent
    Positions the specified dialog at a position relative to its parent.
  • getMaximumWindowBounds
    Computes the maximum bounds of the current screen device. If this method is called on JDK 1.4, Xiner
  • positionFrameRandomly
    Positions the specified frame at a random location on the screen while ensuring that the entire fram

Popular in Java

  • Start an intent from android
  • onRequestPermissionsResult (Fragment)
  • scheduleAtFixedRate (Timer)
  • setScale (BigDecimal)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now