Permalink
Browse files

fixed amount int cast bug and colored charts

  • Loading branch information...
1 parent 6181723 commit 93365a8e7755b34f1ee2fe408d3855515a083698 @ChristophMueller ChristophMueller committed Aug 3, 2012
View
@@ -1,3 +1,4 @@
/CloudProfilingMonitor/dist/
/CloudProfilingMonitor/nbproject/private/
/CloudProfilingMonitor/nbbuild/
+/CloudProfilingMonitor/nbdist/
View
Binary file not shown.
@@ -8,6 +8,7 @@
import info.monitorenter.gui.chart.Chart2D;
import info.monitorenter.gui.chart.ITrace2D;
import info.monitorenter.gui.chart.traces.Trace2DLtd;
+import java.awt.Color;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -30,9 +31,9 @@
valuesMap.put(StringConstants.Tier.DB, new ArrayList<Double>());
tracesMap = new HashMap<>();
- tracesMap.put(StringConstants.Tier.WEB, new Trace2DLtd(ChartPanel.TRACE_SIZE));
- tracesMap.put(StringConstants.Tier.APP, new Trace2DLtd(ChartPanel.TRACE_SIZE));
- tracesMap.put(StringConstants.Tier.DB, new Trace2DLtd(ChartPanel.TRACE_SIZE));
+ tracesMap.put(StringConstants.Tier.WEB, newTrace(ChartPanel.TRACE_SIZE, Color.red));
+ tracesMap.put(StringConstants.Tier.APP, newTrace(ChartPanel.TRACE_SIZE, Color.green));
+ tracesMap.put(StringConstants.Tier.DB, newTrace(ChartPanel.TRACE_SIZE, Color.blue));
for (String tier : tracesMap.keySet()) {
ITrace2D trace = tracesMap.get(tier);
@@ -73,6 +74,12 @@ private void setVisibilityForTraces(boolean visible) {
for (ITrace2D trace : tracesMap.values())
trace.setVisible(visible);
}
+
+ private ITrace2D newTrace(int size, Color color) {
+ ITrace2D trace = new Trace2DLtd(size);
+ trace.setColor(color);
+ return trace;
+ }
}
@@ -240,10 +240,7 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="jPanel5" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
- <Group type="103" groupAlignment="0" max="-2" attributes="0">
- <Component id="defaultSettingsButton" max="32767" attributes="0"/>
- <Component id="submitSettingsButton" max="32767" attributes="0"/>
- </Group>
+ <Component id="submitSettingsButton" min="-2" pref="67" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
@@ -256,8 +253,6 @@
<Component id="jPanel4" max="32767" attributes="0"/>
<Group type="102" alignment="1" attributes="0">
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
- <Component id="defaultSettingsButton" min="-2" max="-2" attributes="0"/>
- <EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="submitSettingsButton" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jPanel3" max="32767" attributes="0"/>
@@ -277,11 +272,6 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="submitSettingsButtonActionPerformed"/>
</Events>
</Component>
- <Component class="javax.swing.JButton" name="defaultSettingsButton">
- <Properties>
- <Property name="text" type="java.lang.String" value="Default"/>
- </Properties>
- </Component>
<Container class="javax.swing.JPanel" name="jPanel3">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
@@ -151,7 +151,6 @@ private void initComponents() {
tier3_VMPanel = new javax.swing.JPanel();
SettingsPanel = new javax.swing.JPanel();
submitSettingsButton = new javax.swing.JButton();
- defaultSettingsButton = new javax.swing.JButton();
jPanel3 = new javax.swing.JPanel();
jLabel7 = new javax.swing.JLabel();
numberOfHostsTextField = new javax.swing.JTextField();
@@ -288,8 +287,6 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
}
});
- defaultSettingsButton.setText("Default");
-
jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Datacenter"));
jLabel7.setText("#Hosts:");
@@ -629,9 +626,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(SettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
- .addComponent(defaultSettingsButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(submitSettingsButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addComponent(submitSettingsButton, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
SettingsPanelLayout.setVerticalGroup(
@@ -642,8 +637,6 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, SettingsPanelLayout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
- .addComponent(defaultSettingsButton)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(submitSettingsButton))
.addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
@@ -1362,7 +1355,6 @@ public void run() {
private javax.swing.JTextField costPerMinTextField;
private javax.swing.JLabel cpuModelLabel;
private javax.swing.JTextArea customModelInput;
- private javax.swing.JButton defaultSettingsButton;
private javax.swing.JTextField delayTextField;
private javax.swing.JButton editBwInModelBtn;
private javax.swing.JButton editBwOutModelBtn;
@@ -28,7 +28,7 @@
// private List<Cloudlet> cloudlets;
private List<Observer> observers;
private List<Integer> dcAffinity;
- private int amount = 0;
+ private double amount = 0;
private double pricePerVm = 0.0;
private double minPerTick = 0.0;
@@ -284,7 +284,7 @@ public void notifyObservers() {
}
- public int getAmount() {
+ public double getAmount() {
return amount;
}

0 comments on commit 93365a8

Please sign in to comment.