Som work on MMChart
This commit is contained in:
parent
fc06570e13
commit
e9a89bb816
@ -1,4 +1,4 @@
|
||||
#Sat, 20 Jan 2018 21:21:05 +0100
|
||||
#Tue, 23 Jan 2018 01:36:03 +0100
|
||||
annotation.processing.enabled=true
|
||||
annotation.processing.enabled.in.editor=false
|
||||
annotation.processing.processors.list=
|
||||
|
@ -1,8 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<NonVisualComponents>
|
||||
<Container class="javax.swing.JPopupMenu" name="popupMenu">
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout">
|
||||
<Property name="useNullLayout" type="boolean" value="true"/>
|
||||
</Layout>
|
||||
</Container>
|
||||
</NonVisualComponents>
|
||||
<Events>
|
||||
<EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="formMouseMoved"/>
|
||||
<EventHandler event="mouseWheelMoved" listener="java.awt.event.MouseWheelListener" parameters="java.awt.event.MouseWheelEvent" handler="formMouseWheelMoved"/>
|
||||
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="formMouseClicked"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||
|
@ -33,6 +33,7 @@ import chart.painter.XLegendPainter;
|
||||
import chart.painter.YLegendPainter;
|
||||
import gui.Globals;
|
||||
import java.awt.Color;
|
||||
import java.awt.Cursor;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.GridBagConstraints;
|
||||
@ -50,7 +51,7 @@ import sesim.Stock;
|
||||
*
|
||||
* @author 7u83 <7u83@mail.ru>
|
||||
*/
|
||||
public class MMChart extends javax.swing.JPanel {
|
||||
public class MMChart extends JPanel {
|
||||
|
||||
Stock stock;
|
||||
|
||||
@ -68,6 +69,11 @@ public class MMChart extends javax.swing.JPanel {
|
||||
ChartPanel xLegend;
|
||||
ChartPanel yLegend;
|
||||
ChartPanel mainChart;
|
||||
|
||||
private int compression=60000;
|
||||
|
||||
|
||||
|
||||
|
||||
private void setupYLegend() {
|
||||
yLegend = new ChartPanel();
|
||||
@ -88,7 +94,7 @@ public class MMChart extends javax.swing.JPanel {
|
||||
this.addMouseMotionListener(yLegend);
|
||||
|
||||
OHLCChartPainter ylp = new YLegendPainter(/*null*/);
|
||||
OHLCData mydata = stock.getOHLCdata(60000);
|
||||
OHLCData mydata = stock.getOHLCdata(compression);
|
||||
|
||||
ylp.setOHLCData(mydata);
|
||||
yLegend.setChartDef(chartDef);
|
||||
@ -116,7 +122,7 @@ public class MMChart extends javax.swing.JPanel {
|
||||
add(xLegend, gbConstraints);
|
||||
|
||||
OHLCChartPainter p;
|
||||
OHLCData mydata = stock.getOHLCdata(60000);
|
||||
OHLCData mydata = stock.getOHLCdata(compression);
|
||||
|
||||
// this.xScrollBar.setMaximum(0);
|
||||
p = new XLegendPainter();
|
||||
@ -136,6 +142,7 @@ public class MMChart extends javax.swing.JPanel {
|
||||
|
||||
private void addMouseMotionListener(JPanel panel) {
|
||||
panel.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
|
||||
@Override
|
||||
public void mouseMoved(java.awt.event.MouseEvent evt) {
|
||||
formMouseMoved(evt);
|
||||
}
|
||||
@ -162,6 +169,9 @@ public class MMChart extends javax.swing.JPanel {
|
||||
mainChart.addChartPainter(p0);
|
||||
|
||||
this.addMouseMotionListener(mainChart);
|
||||
|
||||
|
||||
mainChart.setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
|
||||
|
||||
}
|
||||
|
||||
@ -216,11 +226,23 @@ public class MMChart extends javax.swing.JPanel {
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
|
||||
popupMenu = new javax.swing.JPopupMenu();
|
||||
|
||||
addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
|
||||
public void mouseMoved(java.awt.event.MouseEvent evt) {
|
||||
formMouseMoved(evt);
|
||||
}
|
||||
});
|
||||
addMouseWheelListener(new java.awt.event.MouseWheelListener() {
|
||||
public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) {
|
||||
formMouseWheelMoved(evt);
|
||||
}
|
||||
});
|
||||
addMouseListener(new java.awt.event.MouseAdapter() {
|
||||
public void mouseClicked(java.awt.event.MouseEvent evt) {
|
||||
formMouseClicked(evt);
|
||||
}
|
||||
});
|
||||
setLayout(null);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
@ -231,7 +253,16 @@ public class MMChart extends javax.swing.JPanel {
|
||||
xLegend.repaint();
|
||||
}//GEN-LAST:event_formMouseMoved
|
||||
|
||||
private void formMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseClicked
|
||||
System.out.printf("The mouse was clicked\n");
|
||||
}//GEN-LAST:event_formMouseClicked
|
||||
|
||||
private void formMouseWheelMoved(java.awt.event.MouseWheelEvent evt) {//GEN-FIRST:event_formMouseWheelMoved
|
||||
System.out.printf("Wheel!!!\n");
|
||||
}//GEN-LAST:event_formMouseWheelMoved
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JPopupMenu popupMenu;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
|
@ -3,6 +3,7 @@
|
||||
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<Events>
|
||||
<EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="formMouseMoved"/>
|
||||
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="formMouseClicked"/>
|
||||
<EventHandler event="mouseExited" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="formMouseExited"/>
|
||||
<EventHandler event="mouseEntered" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="formMouseEntered"/>
|
||||
</Events>
|
||||
|
@ -31,7 +31,7 @@ public class ChartPanel extends javax.swing.JPanel implements AdjustmentListener
|
||||
public ChartPanel() {
|
||||
initComponents();
|
||||
|
||||
setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
|
||||
//setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR));
|
||||
|
||||
}
|
||||
|
||||
@ -101,6 +101,9 @@ public class ChartPanel extends javax.swing.JPanel implements AdjustmentListener
|
||||
}
|
||||
});
|
||||
addMouseListener(new java.awt.event.MouseAdapter() {
|
||||
public void mouseClicked(java.awt.event.MouseEvent evt) {
|
||||
formMouseClicked(evt);
|
||||
}
|
||||
public void mouseExited(java.awt.event.MouseEvent evt) {
|
||||
formMouseExited(evt);
|
||||
}
|
||||
@ -141,6 +144,10 @@ public class ChartPanel extends javax.swing.JPanel implements AdjustmentListener
|
||||
repaint();
|
||||
}//GEN-LAST:event_formMouseExited
|
||||
|
||||
private void formMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseClicked
|
||||
getParent().dispatchEvent(evt);
|
||||
}//GEN-LAST:event_formMouseClicked
|
||||
|
||||
@Override
|
||||
public void adjustmentValueChanged(AdjustmentEvent e) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user