|
|
@ -9,10 +9,16 @@ import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.menu.ToolBarDef; |
|
|
|
import com.fr.design.menu.ToolBarDef; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
|
|
|
|
import com.fr.stable.Filter; |
|
|
|
import com.fr.stable.Nameable; |
|
|
|
import com.fr.stable.Nameable; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.BorderFactory; |
|
|
|
import java.awt.*; |
|
|
|
import javax.swing.JPanel; |
|
|
|
|
|
|
|
import javax.swing.JSplitPane; |
|
|
|
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
|
|
|
import java.awt.CardLayout; |
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
|
|
|
|
import java.util.stream.Stream; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Coder: zack |
|
|
|
* Coder: zack |
|
|
@ -27,6 +33,8 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S |
|
|
|
|
|
|
|
|
|
|
|
ShortCut4JControlPane[] shorts; |
|
|
|
ShortCut4JControlPane[] shorts; |
|
|
|
NameableCreator[] creators; |
|
|
|
NameableCreator[] creators; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected Filter<NameableCreator> creatorsFilter; |
|
|
|
private ToolBarDef toolbarDef; |
|
|
|
private ToolBarDef toolbarDef; |
|
|
|
|
|
|
|
|
|
|
|
UIToolbar toolBar; |
|
|
|
UIToolbar toolBar; |
|
|
@ -38,6 +46,7 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S |
|
|
|
|
|
|
|
|
|
|
|
JControlPane() { |
|
|
|
JControlPane() { |
|
|
|
this.initShortCutFactory(); |
|
|
|
this.initShortCutFactory(); |
|
|
|
|
|
|
|
this.initCreatorsFilter(); |
|
|
|
this.initComponentPane(); |
|
|
|
this.initComponentPane(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -106,6 +115,10 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S |
|
|
|
this.checkButtonEnabled(); |
|
|
|
this.checkButtonEnabled(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void initCreatorsFilter() { |
|
|
|
|
|
|
|
this.creatorsFilter = nameableCreator -> true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void initCardPane() { |
|
|
|
protected void initCardPane() { |
|
|
|
this.controlUpdatePane = createControlUpdatePane(); |
|
|
|
this.controlUpdatePane = createControlUpdatePane(); |
|
|
|
|
|
|
|
|
|
|
@ -183,7 +196,12 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public NameableCreator[] creators() { |
|
|
|
public NameableCreator[] creators() { |
|
|
|
return creators == null ? new NameableCreator[0] : creators; |
|
|
|
if (creators == null) { |
|
|
|
|
|
|
|
return new NameableCreator[0]; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
Stream<NameableCreator> nameableCreatorStream = Arrays.stream(creators).filter(creator -> creatorsFilter.accept(creator)); |
|
|
|
|
|
|
|
return nameableCreatorStream.toArray(NameableCreator[]::new); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|