congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
LightFrameAction
Code IndexAdd Tabnine to your IDE (free)

How to use
LightFrameAction
in
kendzi3d.light.ui.action

Best Java code snippets using kendzi3d.light.ui.action.LightFrameAction (Showing top 10 results out of 315)

origin: kendzi/kendzi3d

  @Override
  public void actionPerformed(ActionEvent action) {

    if (lastFrame == null || !lastFrame.isDisplayable()) {
      // only one instance
      LightFrameAction frame = new LightFrameAction(lightService);
      frame.setVisible(true);

      this.lastFrame = frame;
    }
  }
}
origin: kendzi/kendzi3d

@Inject
public LightFrameAction(LightService lightService) {
  this.lightService = lightService;
  load();
}
origin: kendzi/kendzi3d

private void fillForm(LightConfiguration light) {
  getDirectionText().setText("" + light.getDirection());
  getAngleText().setText("" + light.getAngle());
  getLblAmbientColor().setBackground(light.getAmbientColor());
  getLblDiffuseColor().setBackground(light.getDiffuseColor());
}
origin: kendzi/kendzi3d

private boolean validate(Double direction, Double angle) {
  boolean directionError = direction == null || direction < 0 || direction > 360;
  boolean angleError = angle == null || angle < 0 || angle > 90;
  ValidateUtil.setComponentError(getDirectionText(), directionError);
  ValidateUtil.setComponentError(getAngleText(), angleError);
  return !(directionError || angleError);
}
origin: kendzi/kendzi3d

  @Override
  public void run() {
    try {
      LightFrame frame = new LightFrameAction(new kendzi3d.light.service.impl.LightService(new MemoryLightDao()));
      frame.setVisible(true);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
});
origin: kendzi/kendzi3d

@Override
protected void onDefault() {
  LightConfiguration light = lightService.loadDefault();
  fillForm(light);
}
origin: kendzi/kendzi3d

@Override
protected void onSelectAmbientColor() {
  Color color = JColorChooser.showDialog(this, "Select color", getLblAmbientColor().getBackground());
  getLblAmbientColor().setBackground(color);
}
origin: kendzi/kendzi3d

@Override
protected void onSelectDiffuseColor() {
  Color color = JColorChooser.showDialog(this, "Select color", getLblDiffuseColor().getBackground());
  getLblDiffuseColor().setBackground(color);
}
origin: kendzi/kendzi3d

@Override
protected void onOk() {
  String directionText = getDirectionText().getText();
  String angleText = getAngleText().getText();
  Color ambientColor = getLblAmbientColor().getBackground();
  Color diffuseColor = getLblDiffuseColor().getBackground();
  Double direction = ParseUtil.parseDouble(directionText);
  Double angle = ParseUtil.parseDouble(angleText);
  if (validate(direction, angle)) {
    lightService.save(new LightConfiguration(direction, angle, ambientColor, diffuseColor));
    // dispose();
  }
}
origin: kendzi/kendzi3d

private void load() {
  LightConfiguration light = lightService.load();
  if (light == null) {
    light = lightService.loadDefault();
  }
  fillForm(light);
}
kendzi3d.light.ui.actionLightFrameAction

Javadoc

Light frame actions.

Most used methods

  • <init>
  • fillForm
  • getAngleText
  • getDirectionText
  • getLblAmbientColor
  • getLblDiffuseColor
  • isDisplayable
  • load
  • setVisible
  • validate

Popular in Java

  • Making http requests using okhttp
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getApplicationContext (Context)
  • setScale (BigDecimal)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Reference (javax.naming)
  • JFrame (javax.swing)
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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