GridPeer.java 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // Copyright (c) 2011, Peter Lane
  3. // Licensed under the Academic Free License version 3.0
  4. package fan.swtChartWrapper;
  5. import fan.fwt.*;
  6. import fan.gfx.Color;
  7. import fan.sys.*;
  8. import org.eclipse.swtchart.IGrid;
  9. public class GridPeer {
  10. private IGrid _grid = null;
  11. public static GridPeer make (fan.swtChartWrapper.Grid self) throws Exception {
  12. return new GridPeer ();
  13. }
  14. public void setIGrid (IGrid igrid) {
  15. _grid = igrid;
  16. _grid.setForeground (Fwt.get().color(_foreground));
  17. _grid.setStyle (Utility.toSwt (_linestyle));
  18. }
  19. private Color _foreground = Color.gray.lighter();
  20. public Color foreground (fan.swtChartWrapper.Legend self) { return _foreground; }
  21. public void foreground (fan.swtChartWrapper.Legend self, Color v) {
  22. _foreground = v;
  23. if (_grid != null) _grid.setForeground (Fwt.get().color(_foreground));
  24. }
  25. private LineStyle _linestyle = LineStyle.dot;
  26. public LineStyle _linestyle (fan.swtChartWrapper.Grid self) { return _linestyle; }
  27. public void linestyle (fan.swtChartWrapper.Grid self, LineStyle v) {
  28. _linestyle = v;
  29. if (_grid != null) _grid.setStyle (Utility.toSwt (_linestyle));
  30. }
  31. }