public JComponent getController(final TresCanvas canvas) { JPanel panel = new JPanel(new FlowLayout(FlowLayout.CENTER, 1, 0)); Color color = m_algo.getColor(); panel.setBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, color)); panel.setBackground(color); JCheckBox checkBox = new JCheckBox(m_algo.m_name, m_doPaint) { @Override protected void fireItemStateChanged(ItemEvent event) { super.fireItemStateChanged(event); m_doPaint = (event.getStateChange() == ItemEvent.SELECTED); canvas.repaint(); } }; checkBox.setOpaque(false); panel.add(checkBox); panel.add(m_algo.getController(canvas)); return panel; }
public void paint(Graphics g, ChartAxe xTimeAxe, ChartAxe yPriceAxe, Point cursorPoint) { m_algo.paintAlgo(g, xTimeAxe, yPriceAxe, cursorPoint); }
public int paintYAxe(Graphics g, ChartAxe xTimeAxe, int yRight, Map<String, ChartAxe> yAxes) { return m_algo.paintYAxe(g, xTimeAxe, yRight, yAxes); }
public String getRunAlgoParams() { return m_algo.getRunAlgoParams(); } // proxy call
public double getDirectionAdjusted() { return m_algo.getDirectionAdjusted(); } // proxy call
public BaseAlgoWatcher(TresExchData tresExchData, TresAlgo algo) { m_tresExchData = tresExchData; m_algo = algo; algo.setListener(this); }