Advertisement
phl0w

iTPotionMixer v1.5

Apr 14th, 2012
4,730
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 18.51 KB | None | 0 0
  1. import java.awt.AlphaComposite;
  2. import java.awt.Color;
  3. import java.awt.Font;
  4. import java.awt.Graphics;
  5. import java.awt.Graphics2D;
  6. import java.awt.Rectangle;
  7. import java.awt.event.ActionEvent;
  8.  
  9. import javax.swing.DefaultComboBoxModel;
  10. import javax.swing.GroupLayout;
  11. import javax.swing.JButton;
  12. import javax.swing.JCheckBox;
  13. import javax.swing.JComboBox;
  14. import javax.swing.JFrame;
  15. import javax.swing.JLabel;
  16. import javax.swing.JRadioButton;
  17. import javax.swing.LayoutStyle;
  18. import javax.swing.SwingUtilities;
  19.  
  20. import org.powerbot.concurrent.Task;
  21. import org.powerbot.concurrent.strategy.Strategy;
  22. import org.powerbot.game.api.ActiveScript;
  23. import org.powerbot.game.api.Manifest;
  24. import org.powerbot.game.api.methods.Widgets;
  25. import org.powerbot.game.api.methods.input.Mouse;
  26. import org.powerbot.game.api.methods.interactive.Players;
  27. import org.powerbot.game.api.methods.tab.Inventory;
  28. import org.powerbot.game.api.methods.tab.Skills;
  29. import org.powerbot.game.api.methods.widget.Bank;
  30. import org.powerbot.game.api.methods.widget.Camera;
  31. import org.powerbot.game.api.util.Random;
  32. import org.powerbot.game.api.util.Time;
  33. import org.powerbot.game.api.util.Timer;
  34. import org.powerbot.game.api.wrappers.node.Item;
  35. import org.powerbot.game.bot.event.MessageEvent;
  36. import org.powerbot.game.bot.event.listener.MessageListener;
  37. import org.powerbot.game.bot.event.listener.PaintListener;
  38.  
  39. @Manifest(authors = { "Flow_HRS" }, name = "iTPotionMixer", description = "Mix potions! Follow instructions on GUI.", version = 1.5, website = "http://www.powerbot.org/community/topic/674277-potionmixer-mix-potions-for-you/")
  40. public class iTPotionMixer extends ActiveScript implements MessageListener,
  41.         PaintListener {
  42.  
  43.     private int primary, secondary, startXp, startLevel, made;
  44.     private boolean guiInitialized, abSupport, paintSupport = true;
  45.     private String status = "waiting for gui";
  46.     private long startTime;
  47.     private Timer inactivityTimer;
  48.     private State state;
  49.  
  50.     private enum State {
  51.         ITEM_ON_ITEM, MIXING, BANKING;
  52.     }
  53.  
  54.     private Object[][] potData = { { 227, 249, "Unfinished Guam" },
  55.             { 227, 251, "Unfinished Marrentill" },
  56.             { 227, 253, "Unfinished Tarromin" },
  57.             { 227, 255, "Unfinished Harralander" },
  58.             { 227, 257, "Unfinished Ranarr" },
  59.             { 227, 12224, "Unfinished Spirit Weed" },
  60.             { 227, 14886, "Unfinished Wergali" },
  61.             { 227, 259, "Unfinished Irit" },
  62.             { 227, 211, "Unfinished Avantoe" },
  63.             { 227, 263, "Unfinished Kwuarm" },
  64.             { 227, 3000, "Unfinished Snapdragon" },
  65.             { 227, 265, "Unfinished Cadantine" },
  66.             { 227, 2535, "Unfinished Lantadyme" },
  67.             { 227, 267, "Unfinished Dwarf Weed" },
  68.             { 227, 271, "Unfinished Torstol" },
  69.             { 227, 21676, "Unfinished Fellstalk" },
  70.             { 91, 221, "Attack Potion" }, { 93, 235, "Antipoison" },
  71.             { 95, 225, "Strength Potion" }, { 97, 223, "Restore Potion" },
  72.             { 97, 1975, "Energy Potion" }, { 99, 239, "Defence Potion" },
  73.             { 3002, 2152, "Agility Potion" }, { 97, 9736, "Combat Potion" },
  74.             { 99, 231, "Prayer Potion" }, { 101, 221, "Super Attack Potion" },
  75.             { 101, 235, "Super Antipoison" }, { 103, 231, "Fishing Potion" },
  76.             { 103, 2970, "Super Energy Potion" },
  77.             { 103, 10111, "Hunter Potion" },
  78.             { 105, 225, "Super Strength Potion" },
  79.             { 14856, 11525, "Fletching Potion" },
  80.             { 105, 241, "Weapon Poison" },
  81.             { 3004, 223, "Super Restore Potion" },
  82.             { 107, 239, "Super Defence" }, { 2483, 241, "Antifire" },
  83.             { 109, 245, "Ranging Potion" }, { 2483, 3138, "Magic Potion" },
  84.             { 111, 247, "Zamorak Brew" }, { 3002, 6693, "Saradomin Brew" },
  85.             { 21628, 21622, "Prayer Renewal" }, { 95, 592, "Serum 207" },
  86.             { 145, 261, "Extreme Attack" }, { 157, 267, "Extreme Strength" },
  87.             { 163, 2481, "Extreme Defence" },
  88.             { 169, 12539, "Extreme Ranging" }, { 3042, 9594, "Extreme Magic" },
  89.             { 15309, 15313, "Overload" } };
  90.  
  91.     private int[] getIngredients(String potion) {
  92.         for (int i = 0; i < potData.length; i++) {
  93.             if (potData[i][2].equals(potion)) {
  94.                 return new int[] { (Integer) potData[i][0],
  95.                         (Integer) potData[i][1] };
  96.             }
  97.         }
  98.         return new int[] { -1, -1 };
  99.     }
  100.  
  101.     @Override
  102.     public void messageReceived(MessageEvent arg0) {
  103.         String msg = arg0.getMessage();
  104.         if (msg.contains("you put the") || msg.contains("into the vial")
  105.                 || msg.contains("mix the") || msg.contains("serum 207")) {
  106.             made++;
  107.             inactivityTimer = new Timer(0);
  108.         }
  109.     }
  110.  
  111.     @Override
  112.     protected void setup() {
  113.         SwingUtilities.invokeLater(new Runnable() {
  114.             @Override
  115.             public void run() {
  116.                 JFrame ui = new GUI();
  117.                 ui.setVisible(true);
  118.             }
  119.         });
  120.         provide(new Mix());
  121.         provide(new ItemOnItem());
  122.         provide(new Banking());
  123.         provide(new OpenBank());
  124.         provide(new CloseBank());
  125.         provide(new AntiBan());
  126.         startTime = System.currentTimeMillis();
  127.         startXp = Skills.getExperiences()[15];
  128.         startLevel = Skills.getLevels()[15];
  129.         inactivityTimer = new Timer(0);
  130.     }
  131.  
  132.     private AlphaComposite makeComposite(float alpha) {
  133.         int type = AlphaComposite.SRC_OVER;
  134.         return (AlphaComposite.getInstance(type, alpha));
  135.     }
  136.  
  137.     @Override
  138.     public void onRepaint(Graphics g) {
  139.         if (!paintSupport) {
  140.             return;
  141.         }
  142.         Graphics2D g2d = (Graphics2D) g;
  143.  
  144.         Font title = new Font("Monotype Corsiva", Font.PLAIN, 25);
  145.         Font author = new Font("Monotype Corsiva", Font.PLAIN, 16);
  146.         Font info = new Font("Book Antiqua", Font.PLAIN, 15);
  147.  
  148.         Rectangle bg = new Rectangle(10, 23, 250, 155);
  149.         Rectangle border = new Rectangle(8, 21, 254, 159);
  150.         g2d.setColor(Color.MAGENTA);
  151.         g2d.setComposite(makeComposite(0.5f));
  152.         g2d.fill(bg);
  153.         g2d.setColor(Color.BLACK);
  154.         g2d.fill(border);
  155.         g2d.setComposite(makeComposite(1.0f));
  156.  
  157.         g2d.setColor(Color.WHITE);
  158.  
  159.         g2d.fill(new Rectangle(Mouse.getX() + 1, Mouse.getY() - 4, 2, 15));
  160.         g2d.fill(new Rectangle(Mouse.getX() - 6, Mouse.getY() + 2, 16, 2));
  161.  
  162.         int expGained = Skills.getExperiences()[Skills.HERBLORE] - startXp;
  163.         int expHour = (int) ((expGained) * 3600000D / (System
  164.                 .currentTimeMillis() - startTime));
  165.         int madeHour = (int) ((made) * 3600000D / (System.currentTimeMillis() - startTime));
  166.         g2d.setFont(title);
  167.         g2d.drawString("iTPotionMixer", 20, 50);
  168.         g2d.setFont(author);
  169.         g2d.drawString("By: _phl0w", 20, 65);
  170.  
  171.         g2d.setFont(info);
  172.         g2d.drawString("Herblore level: " + Skills.getLevels()[Skills.HERBLORE]
  173.                 + "/" + startLevel + ".", 20, 85);
  174.         g2d.drawString("Herblore experience gained: " + expGained + ".", 20,
  175.                 100);
  176.         g2d.drawString("Herblore experience/hour: " + expHour + ".", 20, 115);
  177.         g2d.drawString("Successfully made " + made + " potions.", 20, 130);
  178.         g2d.drawString("Making " + madeHour + " potions per hour.", 20, 145);
  179.         g2d.drawString("Status: " + status + ".", 20, 160);
  180.         g2d.drawString(
  181.                 "Time running: "
  182.                         + Time.format(System.currentTimeMillis() - startTime)
  183.                         + ".", 20, 175);
  184.     }
  185.  
  186.     private class AntiBan extends Strategy implements Task {
  187.  
  188.         @Override
  189.         public boolean validate() {
  190.             return abSupport && guiInitialized
  191.                     && Players.getLocal().getAnimation() != -1;
  192.         }
  193.  
  194.         @Override
  195.         public void run() {
  196.             if (Random.nextInt(1, 15) <= 2) {
  197.                 executeAntiBan();
  198.             }
  199.             Time.sleep(1000);
  200.         }
  201.  
  202.         private final void executeAntiBan() {
  203.             Camera.setAngle(Random.nextInt(20, 300));
  204.         }
  205.     }
  206.  
  207.     private class Mix extends Strategy implements Task {
  208.  
  209.         @Override
  210.         public boolean validate() {
  211.             return guiInitialized && Widgets.get(905, 14).visible();
  212.  
  213.         }
  214.  
  215.         @Override
  216.         public void run() {
  217.             inactivityTimer = new Timer(0);
  218.             state = State.MIXING;
  219.             Widgets.get(905, 14).click(true);
  220.             status = "mixing";
  221.             Time.sleep(Random.nextInt(400, 900));
  222.         }
  223.     }
  224.  
  225.     private class ItemOnItem extends Strategy implements Task {
  226.  
  227.         @Override
  228.         public boolean validate() {
  229.             return guiInitialized && !Widgets.get(905, 14).visible()
  230.                     && Players.getLocal().getAnimation() == -1
  231.                     && !Bank.isOpen();
  232.         }
  233.  
  234.         @Override
  235.         public void run() {
  236.             state = State.ITEM_ON_ITEM;
  237.             Item prim = Inventory.getItem(primary);
  238.             Item sec = Inventory.getItem(secondary);
  239.             if (prim.getWidgetChild().getActions()[0].equals("Use")) {
  240.                 Mouse.hop(
  241.                         prim.getWidgetChild().getAbsoluteX()
  242.                                 + Random.nextInt(0, 7), prim.getWidgetChild()
  243.                                 .getAbsoluteY() + Random.nextInt(0, 7));
  244.                 Mouse.click(true);
  245.                 Mouse.hop(
  246.                         sec.getWidgetChild().getAbsoluteX()
  247.                                 + Random.nextInt(0, 7), sec.getWidgetChild()
  248.                                 .getAbsoluteY() + Random.nextInt(0, 7));
  249.                 Mouse.click(true);
  250.             } else {
  251.                 prim.getWidgetChild().interact("Use");
  252.                 sec.getWidgetChild().interact("Use");
  253.             }
  254.             while (!Widgets.get(905, 14).visible()) {
  255.                 Time.sleep(50, 100);
  256.             }
  257.         }
  258.     }
  259.  
  260.     private class CloseBank extends Strategy implements Task {
  261.  
  262.         @Override
  263.         public boolean validate() {
  264.             return guiInitialized && Bank.isOpen()
  265.                     && Inventory.getCount(primary) > 0
  266.                     && Inventory.getCount(secondary) > 0;
  267.         }
  268.  
  269.         @Override
  270.         public void run() {
  271.             state = State.BANKING;
  272.             Mouse.hop(
  273.                     Widgets.get(Bank.WIDGET_BANK, Bank.WIDGET_BUTTON_CLOSE_BANK)
  274.                             .getAbsoluteX(),
  275.                     Widgets.get(Bank.WIDGET_BANK, Bank.WIDGET_BUTTON_CLOSE_BANK)
  276.                             .getAbsoluteY());
  277.             Mouse.click(true);
  278.             Time.sleep(100, 200);
  279.         }
  280.     }
  281.  
  282.     private class OpenBank extends Strategy implements Task {
  283.  
  284.         @Override
  285.         public boolean validate() {
  286.             return guiInitialized
  287.                     && ((Inventory.getCount(primary) == 0 || Inventory
  288.                             .getCount(secondary) == 0) && !Bank.isOpen())
  289.                     || (inactivityTimer.getElapsed() >= 15000 && state == State.MIXING);
  290.         }
  291.  
  292.         @Override
  293.         public void run() {
  294.             state = State.BANKING;
  295.             status = "banking";
  296.             while (!Bank.open()) {
  297.                 Time.sleep(Random.nextInt(80, 120));
  298.             }
  299.             Time.sleep(Random.nextInt(300, 400));
  300.         }
  301.     }
  302.  
  303.     private class Banking extends Strategy implements Task {
  304.  
  305.         @Override
  306.         public boolean validate() {
  307.             return guiInitialized
  308.                     && ((Inventory.getCount(primary) == 0 || Inventory
  309.                             .getCount(secondary) == 0) && Bank.isOpen())
  310.                     || inactivityTimer.getElapsed() >= 30000;
  311.         }
  312.  
  313.         @Override
  314.         public void run() {
  315.             state = State.BANKING;
  316.             if (Inventory.getCount() != 0) {
  317.                 Mouse.hop(
  318.                         Widgets.get(Bank.WIDGET_BANK,
  319.                                 Bank.WIDGET_BUTTON_DEPOSIT_INVENTORY)
  320.                                 .getAbsoluteX(),
  321.                         Widgets.get(Bank.WIDGET_BANK,
  322.                                 Bank.WIDGET_BUTTON_DEPOSIT_INVENTORY)
  323.                                 .getAbsoluteY());
  324.                 Mouse.click(true);
  325.             } else {
  326.                 if (primary == 15309 && secondary == 15313) { // Overloads
  327.                     Bank.withdraw(primary, 4);
  328.                     Bank.withdraw(secondary, 4);
  329.                     Bank.withdraw(15317, 4);
  330.                     Bank.withdraw(15321, 4);
  331.                     Bank.withdraw(15325, 4);
  332.                     Bank.withdraw(269, 4);
  333.                 }
  334.                 Bank.withdraw(primary, primary == 169 ? 0 : 14);
  335.                 Time.sleep(Random.nextInt(350, 750));
  336.                 if (secondary != 12539) {
  337.                     Bank.withdraw(secondary, 14);
  338.                     Time.sleep(Random.nextInt(172, 257));
  339.                 }
  340.             }
  341.         }
  342.     }
  343.  
  344.     public class GUI extends JFrame {
  345.  
  346.         private static final long serialVersionUID = 1L;
  347.  
  348.         public GUI() {
  349.             try {
  350.                 initComponents();
  351.             } catch (Exception e) {
  352.                 log.info("Ignored");
  353.             }
  354.         }
  355.  
  356.         private void initComponents() {
  357.             jCheckBox1 = new JCheckBox();
  358.             jButton1 = new JButton();
  359.             jCheckBox2 = new JCheckBox();
  360.             jLabel1 = new JLabel();
  361.             jRadioButton1 = new JRadioButton();
  362.             jRadioButton2 = new JRadioButton();
  363.             jComboBox1 = new JComboBox();
  364.             jLabel4 = new JLabel();
  365.  
  366.             setTitle("PotionMixer");
  367.  
  368.             jCheckBox1.setSelected(true);
  369.             jCheckBox1.setText("Enable antiban?");
  370.  
  371.             jButton1.setText("Start");
  372.             jButton1.addActionListener(new java.awt.event.ActionListener() {
  373.                 public void actionPerformed(java.awt.event.ActionEvent evt) {
  374.                     jButton1ActionPerformed(evt);
  375.                 }
  376.             });
  377.  
  378.             jCheckBox2.setSelected(true);
  379.             jCheckBox2.setText("Enable paint?");
  380.  
  381.             jLabel1.setText("Squeal spin ticket options:");
  382.  
  383.             jRadioButton1.setSelected(true);
  384.             jRadioButton1.setEnabled(false);
  385.             jRadioButton1.setText("Claim ticket");
  386.             jRadioButton1
  387.                     .addActionListener(new java.awt.event.ActionListener() {
  388.                         public void actionPerformed(
  389.                                 java.awt.event.ActionEvent evt) {
  390.                             jRadioButton1ActionPerformed(evt);
  391.                         }
  392.                     });
  393.  
  394.             jRadioButton2.setText("Destroy ticket");
  395.             jRadioButton2.setEnabled(false);
  396.             jRadioButton2
  397.                     .addActionListener(new java.awt.event.ActionListener() {
  398.                         public void actionPerformed(
  399.                                 java.awt.event.ActionEvent evt) {
  400.                             jRadioButton2ActionPerformed(evt);
  401.                         }
  402.                     });
  403.  
  404.             jComboBox1.setModel(new DefaultComboBoxModel(new String[] {
  405.                     "Agility Potion", "Antifire", "Antipoison",
  406.                     "Attack Potion", "Combat Potion", "Crafting Potion",
  407.                     "Defence Potion", "Energy Potion", "Fishing Potion",
  408.                     "Fletching Potion", "Hunter Potion", "Magic Potion",
  409.                     "Prayer Potion", "Prayer Renewal", "Ranging Potion",
  410.                     "Restore Potion", "Saradomin Brew", "Serum 207",
  411.                     "Strength Potion", "Super Antipoison",
  412.                     "Super Attack Potion", "Super Defence",
  413.                     "Super Energy Potion", "Super Restore Potion",
  414.                     "Super Strength Potion", "Weapon Poison", "Zamorak Brew",
  415.                     "Extreme Attack", "Extreme Strength", "Extreme Defence",
  416.                     "Extreme Ranging", "Extreme Magic", "Overload",
  417.                     "Unfinished Avantoe", "Unfinished Cadantine",
  418.                     "Unfinished Dwarf Weed", "Unfinished Fellstalk",
  419.                     "Unfinished Guam", "Unfinished Harralander",
  420.                     "Unfinished Irit", "Unfinished Kwuarm",
  421.                     "Unfinished Lantadyme", "Unfinished Marrentill",
  422.                     "Unfinished Ranarr", "Unfinished Snapdragon",
  423.                     "Unfinished Spirit Weed", "Unfinished Tarromin",
  424.                     "Unfinished Torstol", "Unfinished Wergali" }));
  425.  
  426.             jLabel4.setText("Select potion:");
  427.  
  428.             GroupLayout layout = new GroupLayout(getContentPane());
  429.             getContentPane().setLayout(layout);
  430.             layout.setHorizontalGroup(layout
  431.                     .createParallelGroup(GroupLayout.Alignment.LEADING)
  432.                     .addGroup(
  433.                             layout.createSequentialGroup()
  434.                                     .addContainerGap()
  435.                                     .addGroup(
  436.                                             layout.createParallelGroup(
  437.                                                     GroupLayout.Alignment.LEADING)
  438.                                                     .addGroup(
  439.                                                             GroupLayout.Alignment.TRAILING,
  440.                                                             layout.createSequentialGroup()
  441.                                                                     .addGap(0,
  442.                                                                             0,
  443.                                                                             Short.MAX_VALUE)
  444.                                                                     .addComponent(
  445.                                                                             jButton1,
  446.                                                                             GroupLayout.PREFERRED_SIZE,
  447.                                                                             260,
  448.                                                                             GroupLayout.PREFERRED_SIZE))
  449.                                                     .addGroup(
  450.                                                             layout.createSequentialGroup()
  451.                                                                     .addGroup(
  452.                                                                             layout.createParallelGroup(
  453.                                                                                     GroupLayout.Alignment.LEADING)
  454.                                                                                     .addComponent(
  455.                                                                                             jLabel1)
  456.                                                                                     .addGroup(
  457.                                                                                             layout.createSequentialGroup()
  458.                                                                                                     .addComponent(
  459.                                                                                                             jRadioButton1)
  460.                                                                                                     .addGap(60,
  461.                                                                                                             60,
  462.                                                                                                             60)
  463.                                                                                                     .addComponent(
  464.                                                                                                             jRadioButton2))
  465.                                                                                     .addComponent(
  466.                                                                                             jLabel4)
  467.                                                                                     .addGroup(
  468.                                                                                             layout.createParallelGroup(
  469.                                                                                                     GroupLayout.Alignment.TRAILING,
  470.                                                                                                     false)
  471.                                                                                                     .addComponent(
  472.                                                                                                             jComboBox1,
  473.                                                                                                             0,
  474.                                                                                                             GroupLayout.DEFAULT_SIZE,
  475.                                                                                                             Short.MAX_VALUE)
  476.                                                                                                     .addGroup(
  477.                                                                                                             layout.createSequentialGroup()
  478.                                                                                                                     .addComponent(
  479.                                                                                                                             jCheckBox1,
  480.                                                                                                                             GroupLayout.PREFERRED_SIZE,
  481.                                                                                                                             137,
  482.                                                                                                                             GroupLayout.PREFERRED_SIZE)
  483.                                                                                                                     .addPreferredGap(
  484.                                                                                                                             LayoutStyle.ComponentPlacement.RELATED)
  485.                                                                                                                     .addComponent(
  486.                                                                                                                             jCheckBox2))))
  487.                                                                     .addGap(0,
  488.                                                                             0,
  489.                                                                             Short.MAX_VALUE)))
  490.                                     .addContainerGap()));
  491.             layout.setVerticalGroup(layout
  492.                     .createParallelGroup(GroupLayout.Alignment.LEADING)
  493.                     .addGroup(
  494.                             layout.createSequentialGroup()
  495.                                     .addContainerGap()
  496.                                     .addComponent(jLabel4)
  497.                                     .addGap(1, 1, 1)
  498.                                     .addComponent(jComboBox1,
  499.                                             GroupLayout.PREFERRED_SIZE,
  500.                                             GroupLayout.DEFAULT_SIZE,
  501.                                             GroupLayout.PREFERRED_SIZE)
  502.                                     .addGroup(
  503.                                             layout.createParallelGroup(
  504.                                                     GroupLayout.Alignment.LEADING)
  505.                                                     .addGroup(
  506.                                                             layout.createSequentialGroup()
  507.                                                                     .addGap(7,
  508.                                                                             7,
  509.                                                                             7)
  510.                                                                     .addComponent(
  511.                                                                             jCheckBox1))
  512.                                                     .addGroup(
  513.                                                             layout.createSequentialGroup()
  514.                                                                     .addPreferredGap(
  515.                                                                             LayoutStyle.ComponentPlacement.RELATED,
  516.                                                                             GroupLayout.DEFAULT_SIZE,
  517.                                                                             Short.MAX_VALUE)
  518.                                                                     .addComponent(
  519.                                                                             jCheckBox2)))
  520.                                     .addPreferredGap(
  521.                                             LayoutStyle.ComponentPlacement.RELATED)
  522.                                     .addComponent(jLabel1)
  523.                                     .addPreferredGap(
  524.                                             LayoutStyle.ComponentPlacement.RELATED)
  525.                                     .addGroup(
  526.                                             layout.createParallelGroup(
  527.                                                     GroupLayout.Alignment.BASELINE)
  528.                                                     .addComponent(jRadioButton1)
  529.                                                     .addComponent(jRadioButton2))
  530.                                     .addPreferredGap(
  531.                                             LayoutStyle.ComponentPlacement.RELATED)
  532.                                     .addComponent(jButton1)
  533.                                     .addContainerGap(GroupLayout.DEFAULT_SIZE,
  534.                                             Short.MAX_VALUE)));
  535.  
  536.             pack();
  537.         }
  538.  
  539.         private void jButton1ActionPerformed(ActionEvent evt) {
  540.             primary = getIngredients(jComboBox1.getSelectedItem().toString())[0];
  541.             secondary = getIngredients(jComboBox1.getSelectedItem().toString())[1];
  542.             abSupport = jCheckBox1.isSelected();
  543.             paintSupport = jCheckBox2.isSelected();
  544.             guiInitialized = true;
  545.             log.info("GUI done.");
  546.             dispose();
  547.         }
  548.  
  549.         private void jRadioButton1ActionPerformed(ActionEvent evt) {
  550.             jRadioButton1.setSelected(true);
  551.             jRadioButton2.setSelected(false);
  552.         }
  553.  
  554.         private void jRadioButton2ActionPerformed(ActionEvent evt) {
  555.             jRadioButton1.setSelected(false);
  556.             jRadioButton2.setSelected(true);
  557.         }
  558.  
  559.         private JButton jButton1;
  560.         private JCheckBox jCheckBox1;
  561.         private JCheckBox jCheckBox2;
  562.         private JComboBox jComboBox1;
  563.         private JLabel jLabel1;
  564.         private JLabel jLabel4;
  565.         private JRadioButton jRadioButton1;
  566.         private JRadioButton jRadioButton2;
  567.     }
  568. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement