1 package org.antlr.works.components.grammar; 2 3 import javax.swing.*; 4 34 35 public class CEditorGrammarDefaultDelegate implements CEditorGrammarDelegate { 36 37 public JSplitPane splitPane; 38 39 public CEditorGrammarDefaultDelegate(JSplitPane splitPane) { 40 this.splitPane = splitPane; 41 } 42 43 public void setBottomComponentVisible(boolean visible) { 44 if(visible) { 45 splitPane.setDividerLocation(splitPane.getLastDividerLocation()); 46 if(!isBottomComponentVisible()) 49 splitPane.setDividerLocation(0.6f); 50 } else { 51 splitPane.setDividerLocation(1.0f); 52 } 53 } 54 55 public boolean isBottomComponentVisible() { 56 return splitPane.getBottomComponent().getHeight() != 0; 57 } 58 } 59 | Popular Tags |