cross cursor

This commit is contained in:
7u83
2017-04-18 08:20:44 +02:00
parent f5a60d9611
commit a7de69b6bb
5 changed files with 58 additions and 2 deletions

View File

@ -14,6 +14,9 @@
</Property>
<Property name="requestFocusEnabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="mouseMoved" listener="java.awt.event.MouseMotionListener" parameters="java.awt.event.MouseEvent" handler="formMouseMoved"/>
</Events>
<AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>

View File

@ -500,6 +500,9 @@ public class Chart extends javax.swing.JPanel implements QuoteReceiver, Scrollab
return;
}
// Point m = MouseInfo.getPointerInfo().getLocation() ;
// g.drawLine(0, m.y, 1000, m.y);
int pwidth = (int) (em_width * x_unit_width * (num_bars + 1)) + clip_bounds.width;
this.setPreferredSize(new Dimension(pwidth, gdim.height));
@ -699,6 +702,11 @@ public class Chart extends javax.swing.JPanel implements QuoteReceiver, Scrollab
setOpaque(false);
setPreferredSize(new java.awt.Dimension(300, 300));
setRequestFocusEnabled(false);
addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {
public void mouseMoved(java.awt.event.MouseEvent evt) {
formMouseMoved(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
@ -712,6 +720,10 @@ public class Chart extends javax.swing.JPanel implements QuoteReceiver, Scrollab
);
}// </editor-fold>//GEN-END:initComponents
private void formMouseMoved(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseMoved
}//GEN-LAST:event_formMouseMoved
@Override
public void UpdateQuote(Quote q) {
this.repaint();