Tabnine Logo
Environment.getSize
Code IndexAdd Tabnine to your IDE (free)

How to use
getSize
method
in
it.unibo.alchemist.model.interfaces.Environment

Best Java code snippets using it.unibo.alchemist.model.interfaces.Environment.getSize (Showing top 5 results out of 315)

origin: it.unibo.alchemist/alchemist-swingui

private double getEnvRatio() {
  final double[] size = model.getSize();
  return size[0] / size[1];
}
origin: it.unibo.alchemist/alchemist-swingui

/**
 * Gets the viewHeight / envHeight ratio.<br>
 * NI = Not Isometric.
 * 
 * @return a <code>double</code> value representing the vertical ratio for
 *         Not Isometric mode
 */
private double getNIVerticalRatio() {
  if (mode == Mode.ISOMETRIC) {
    return 1d;
  } else if (mode == Mode.ADAPT_TO_VIEW) {
    return view.getHeight() / model.getSize()[1];
  } else {
    return vRate;
  }
}
origin: it.unibo.alchemist/alchemist-swingui

/**
 * Gets the viewWidth / envWidth ratio.<br>
 * NI = Not Isometric.
 * 
 * @return a <code>double</code> value representing the horizontal ratio for
 *         Not Isometric mode
 */
private double getNIHorizontalRatio() {
  if (mode == Mode.ISOMETRIC) {
    return 1d;
  } else if (mode == Mode.ADAPT_TO_VIEW) {
    return view.getWidth() / model.getSize()[0];
  } else {
    return hRate;
  }
}
origin: it.unibo.alchemist/alchemist-swingui

@Override
public void optimalZoom() {
  if (getEnvRatio() <= getViewRatio()) {
    zoom = Math.max(1, view.getHeight()) / model.getSize()[1];
  } else {
    zoom = Math.max(1, view.getWidth()) / model.getSize()[0];
  }
}
origin: it.unibo.alchemist/alchemist-swingui

@Override
public void center() {
  final double[] off = getEnvironment().getOffset();
  final double[] size = getEnvironment().getSize();
  final PointAdapter center = isNaN(off[0]) || isNaN(off[1]) || size[0] <= 0 || size[1] <= 0
      ? from(0, 0)
      : from(off[0] + size[0] / 2, off[1] + size[1] / 2);
  setEnvPosition(center.toPosition());
}
it.unibo.alchemist.model.interfacesEnvironmentgetSize

Popular methods of Environment

  • getNeighborhood
  • getPosition
  • getDistanceBetweenNodes
  • getNodes
  • getSimulation
  • getLayer
  • getNodeByID
  • getOffset
  • isTerminated
  • removeNode
  • setSimulation
  • setSimulation

Popular in Java

  • Start an intent from android
  • getSharedPreferences (Context)
  • getSupportFragmentManager (FragmentActivity)
  • compareTo (BigDecimal)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Top Vim plugins
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