Giter Site home page Giter Site logo

Comments (4)

HanSolo avatar HanSolo commented on August 21, 2024

Well the FGauge is more or less a special wrapper around a Gauge. So you should not use a styled gauge like you did but more like in the following example.

`import java.util.logging.Logger;

import eu.hansolo.medusa.Gauge.SkinType;
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.geometry.NodeOrientation;
import javafx.scene.Scene;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;

public class MainApp extends Application {

private static final Logger LOGGER = Logger.getLogger(MainApp.class.getName());

public static void main( String[] args ) {
    launch(args);
}

private Gauge gauge;
private FGauge fgauge;

@Override public void init() throws Exception {

    GaugeDesign design = GaugeDesign.NONE;
    SkinType    skin   = Gauge.SkinType.SIMPLE_SECTION;

    gauge = GaugeBuilder.create().build();
    gauge.setMouseTransparent(true);

    fgauge = FGaugeBuilder.create()
                          .gauge(gauge)
                          .build();

    fgauge.addEventHandler(MouseEvent.MOUSE_PRESSED, e -> System.out.println("*** SELECTED"));
}

@Override public void start( Stage stage ) throws Exception {

    StackPane pane = new StackPane(fgauge);

    pane.setPadding(new Insets(20));
    pane.setNodeOrientation(NodeOrientation.LEFT_TO_RIGHT);

    Scene scene = new Scene(pane);

    stage.setTitle("Medusa Clock Test");
    stage.setScene(scene);
    stage.show();
}

}
`

from medusa.

claudio-rosati avatar claudio-rosati commented on August 21, 2024

Thank you for the gauge.setMouseTransparent(true); hint.

Have you seen the resize problem?

from medusa.

HanSolo avatar HanSolo commented on August 21, 2024

I sometimes see that the gauge is not aligned correctly which seems to be the case if I resize too fast. The whole FGauge control is more to show the possibility of using borders to create some kind of frame around a Gauge control. I would suggest not to use it in the current state. To be honest I was thinking about to remove the FGauge from the lib.

from medusa.

claudio-rosati avatar claudio-rosati commented on August 21, 2024

OK, I'll not use it.
Thank you

from medusa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.