Newer
Older
CactusServer / src / main / java / framework / gameMain / BaseScenarioGameContainer.java
y-ota on 10 May 2018 1 KB 初うp
  1. package framework.gameMain;
  2.  
  3. import java.awt.GraphicsConfiguration;
  4.  
  5. import framework.RWT.RWTCanvas3D;
  6. import framework.RWT.RWTContainer;
  7. import framework.RWT.RWTLabel;
  8. import framework.scenario.ScenarioManager;
  9.  
  10. /**
  11. * シナリオゲーム用画面
  12. * @author Nitta
  13. *
  14. */
  15. abstract public class BaseScenarioGameContainer extends RWTContainer {
  16. protected RWTCanvas3D canvas;
  17. protected RWTLabel dialog;
  18. protected ScenarioManager scenario;
  19.  
  20. public BaseScenarioGameContainer(ScenarioManager scenario) {
  21. this.scenario = scenario;
  22. }
  23.  
  24. @Override
  25. public void build(GraphicsConfiguration gc) {
  26. if (gc != null) {
  27. canvas = new RWTCanvas3D(gc);
  28. } else {
  29. canvas = new RWTCanvas3D();
  30. }
  31. dialog = new RWTLabel();
  32. }
  33.  
  34. public void dialogOpen() {
  35. dialog.setVisible(true);
  36. repaint();
  37. }
  38.  
  39. public void dialogClose() {
  40. dialog.setVisible(false);
  41. repaint();
  42. }
  43.  
  44. public void dialogMessage(String message) {
  45. dialog.setString(message);
  46. repaint();
  47. }
  48.  
  49. public boolean isDialogOpen() {
  50. return dialog.isVisible();
  51. }
  52. }