Package java.awt

Examples of java.awt.Choice$State


      setLocation(d.width * 3 / 8 + 50, d.height * 3 / 8 - 30);
      p1 = new JPanel();
      p2 = new JPanel();
      add("Center", p1);
      repeat = defaultRepeat;
      choiceBox = new Choice();
      choiceBox.addItemListener(this);
      choiceBox.add("No Repeat");
      choiceBox.add("Repeat Loop");
      choiceBox.add("Repeat Reverse");
      p1.add(new JLabel("Choose Repeat Mode!"));
View Full Code Here


      p1 = new JPanel();
      p2 = new JPanel();
      getContentPane().add("Center", p1);
      portName = null;
      defaultPortName = defaultPort;
      choiceBox = new Choice();
      choiceBox.addItemListener(this);

      /**
      try {
        //System.out.println("Default port == " + defaultPort);
View Full Code Here

  */
  public SimController(SimModel m, boolean splash) {
    super(m, splash);
    setSimModel(m);
   
    speedChoice=new Choice();
    Enumeration e=Arrayutils.getEnumeration(speedTexts);
    while (e.hasMoreElements())
      speedChoice.add((String)(e.nextElement()));
   
    setSpeed((int)(speedTexts.length / 2));
View Full Code Here

   
    //Crée une liste déroulante vierge
    station = new JComboBox();
   
    //Liste déroulante contenant "semaine" ou "week-end"
    Choice period = new Choice();
    period.addItem("Semaine");
    period.addItem("Week-end");
   
    Line tempLine = new Line();
    Station tempStation = new Station();
    Period tempPeriod = new Period();
   
    //Crée un message contenant des chaînes de caractères et les listes déroulantes
    Object[] message = new Object[] { "Ligne : ", line,
        "Station : ", station, "Période : " , period};
   
    //Crée la pop-up contenant le message
    int r = JOptionPane.showConfirmDialog(null, message,
        "Modifier des horaires", JOptionPane.OK_CANCEL_OPTION);
   
    //Si l'utilisateur a cliqué sur le bouton "OK"
    if (r == JOptionPane.OK_OPTION) {
      tempLine.setName(line.getSelectedItem().toString());
      tempStation.setName(station.getSelectedItem().toString());
     
      if(period.getSelectedItem()=="Semaine")
        numberPeriod=0;
      else
        numberPeriod=1;
     
      temp.setLine(tempLine);
View Full Code Here

   * @param converted La ligne sélectionnée
   */
  private void choosePeriod(Station toShow, Line converted) {
   
    //Liste déroulante contenant "semaine" ou "week-end"
    Choice period = new Choice();
    period.addItem("Semaine");
    period.addItem("Week-end");

    //Message contenant une chaîne de caractères avec l'horaire du prochain passage
    //et la période dans laquelle est situé cet horaire
    Object[] message = new Object[] {
        "Prochain passage : "
            + this.controller.getMap().getNextArrival(
                converted, toShow) + "\nPériode : ",
        period };

    //Crée la pop-up contenant le message
    int r = JOptionPane.showConfirmDialog(null, message,
        "Choisissez votre période",
        JOptionPane.OK_CANCEL_OPTION);

    String label = new String();

    //Si l'utilisateur a cliqué sur le bouton "OK"
    if (r == JOptionPane.OK_OPTION) {
      label = period.getSelectedItem();
      this.displaySchedule(label, toShow, converted);
    }
  }
View Full Code Here

   
    //Crée une liste déroulante vierge
    station = new JComboBox();
   
    //Liste déroulante contenant "semaine" ou "week-end"
    Choice period = new Choice();
    period.addItem("Semaine");
    period.addItem("Week-end");
   
    Line tempLine = new Line();
    Station tempStation = new Station();
    Period tempPeriod = new Period();
   
    //Crée un message contenant des chaînes de caractères et les listes déroulantes
    Object[] message = new Object[] { "Ligne : ", line,
        "Station : ", station, "Période : " , period};
   
    //Crée la pop-up contenant le message
    int r = JOptionPane.showConfirmDialog(null, message,
        "Modifier des horaires", JOptionPane.OK_CANCEL_OPTION);
   
    //Si l'utilisateur a cliqué sur le bouton "OK"
    if (r == JOptionPane.OK_OPTION) {
      tempLine.setName(line.getSelectedItem().toString());
      tempStation.setName(station.getSelectedItem().toString());
     
      if(period.getSelectedItem()=="Semaine")
        numberPeriod=0;
      else
        numberPeriod=1;
     
      temp.setLine(tempLine);
View Full Code Here

   */
  @Override
  public void createPopup() {

    //Liste déroulante contenant les types de transports possibles
    Choice transportType = new Choice();
    transportType.addItem(TransportType.BUS.toString());
    transportType.addItem(TransportType.METRO.toString());
    transportType.addItem(TransportType.TRAMWAY.toString());

    //Champ de texte vide
    JTextField name = new JTextField();
   
    //Crée un message contenant des chaînes de caractères, la liste déroulante
    //ainsi que le champ de texte
    Object[] message = new Object[] { "Nom de la ligne : ", name,
        "Type de la ligne : ", transportType };
   
    //Crée la pop-up contenant le message
    int r = JOptionPane.showConfirmDialog(null, message,
        "Ajouter une ligne", JOptionPane.OK_CANCEL_OPTION);
   
    //Si l'utilisateur a cliqué sur le bouton "OK"
    if (r == JOptionPane.OK_OPTION) {
      String tempType = transportType.getSelectedItem();
      if(tempType=="BUS")
      temp.setTransportType(TransportType.BUS);
      else if(tempType=="METRO")
      temp.setTransportType(TransportType.METRO);
      else if(tempType=="TRAMWAY")
View Full Code Here

   
    //Champ de texte modifiable contenant le nom de la ligne
    JTextField name = new JTextField(temp.getName());
   
    //Liste déroulante contenant les types de transports possibles
    Choice transportType = new Choice();
    transportType.addItem(TransportType.BUS.toString());
    transportType.addItem(TransportType.METRO.toString());
    transportType.addItem(TransportType.TRAMWAY.toString());
    transportType.select(temp.getTransportType().toString());
   
    String[] stations = controller.getStationsNames();
   
    //Liste déroulante avec système d'auto-complétion contenant les
    //noms des stations
    JComboBox terminus1 = new JComboBox();
    AutoCompleteSupport support = AutoCompleteSupport.install(
            terminus1, GlazedLists.eventListOf(stations));
    terminus1.setSelectedItem(temp.getStations().get(0).getName());
   
    JComboBox terminus2 = new JComboBox();
    AutoCompleteSupport support2 = AutoCompleteSupport.install(
            terminus2, GlazedLists.eventListOf(stations));
    terminus2.setSelectedItem(temp.getStations().get(1).getName());
   
    //Message contenant le champ de texte et les 3 listes déroulantes
    Object[] message = new Object[] { name, transportType, terminus1, terminus2};
   
    //Lance la pop-up de modification contenant le message
    int r = JOptionPane.showConfirmDialog(null, message,
        "Modifiez les valeurs", JOptionPane.OK_CANCEL_OPTION);
   
    //Si l'utilisateur a cliqué sur le bouton "OK"
    if (r == JOptionPane.OK_OPTION) {
      String tempType = transportType.getSelectedItem();
      if(tempType=="BUS")
      temp.setTransportType(TransportType.BUS);
      else if(tempType=="METRO")
      temp.setTransportType(TransportType.METRO);
      else if(tempType=="TRAMWAY")
View Full Code Here

   
    //Crée une liste déroulante vierge
    station = new JComboBox();
   
    //Liste déroulante contenant "semaine" ou "week-end"
    Choice period = new Choice();
    period.addItem("Semaine");
    period.addItem("Week-end");
   
    Line tempLine = new Line();
    Station tempStation = new Station();
   
    //Crée un message contenant des chaînes de caractères et les listes déroulantes
    Object[] message = new Object[] { "Ligne : ", line,
        "Station : ", station, "Période : " , period};
   
    //Crée la pop-up contenant le message
    int r = JOptionPane.showConfirmDialog(null, message,
        "Ajouter des horaires", JOptionPane.OK_CANCEL_OPTION);
   
    //Si l'utilisateur a cliqué sur le bouton "OK"
    if (r == JOptionPane.OK_OPTION) {
      tempLine.setName(line.getSelectedItem().toString());
      tempStation.setName(station.getSelectedItem().toString());
     
      if(period.getSelectedItem()=="Semaine")
        numberPeriod=0;
      else
        numberPeriod=1;
     
      tempLine=controller.copyLine(tempLine);
View Full Code Here

        frame.setSize(200, 200);
        frame.setLayout(new GridLayout(6, 1));

        frame.add(new Label("Status:"));
        Choice status = new Choice();
        for (int i = 0; i < Status.values().length; ++i)
            status.add(Status.values()[i].toString());
        frame.add(status);

        frame.add(new Label("Value:"));
        outputTimestamp = new Label();
        frame.add(outputTimestamp);
        outputQuality = new Label();
        frame.add(outputQuality);
        outputValue = new Label();
        frame.add(outputValue);

        frame.addWindowListener(this);
        status.addItemListener(this);

        frame.setVisible(true);

        updateValue();
    }
View Full Code Here

TOP

Related Classes of java.awt.Choice$State

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.