Browse Source

设计器初始界面镜像化

persist/11.0-arabic
obo 4 months ago
parent
commit
c6520486b1
  1. 61
      designer-base/src/main/java/com/fr/base/i18n/BidiUtils.java
  2. 3
      designer-base/src/main/java/com/fr/design/actions/UpdateAction.java
  3. 2
      designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java
  4. 3
      designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java
  5. 7
      designer-base/src/main/java/com/fr/design/data/datapane/management/search/pane/TreeSearchToolbarPane.java
  6. 21
      designer-base/src/main/java/com/fr/design/file/MultiTemplateTabMenuFactory.java
  7. 23
      designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java
  8. 17
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java
  9. 51
      designer-base/src/main/java/com/fr/design/gui/ilable/LocaleOrientationLabel.java
  10. 3
      designer-base/src/main/java/com/fr/design/gui/ilable/UILabel.java
  11. 12
      designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuItemUI.java
  12. 17
      designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java
  13. 12
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  14. 4
      designer-base/src/main/java/com/fr/design/mainframe/NorthRegionContainerPane.java
  15. 4
      designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java
  16. 2
      designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java
  17. 4
      designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pane/TemplateTreeSearchToolbarPane.java
  18. 3
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  19. 5
      designer-base/src/main/java/com/fr/design/menu/MenuDef.java
  20. 3
      designer-base/src/main/java/com/fr/design/menu/ToolBarDef.java

61
designer-base/src/main/java/com/fr/base/i18n/BidiUtils.java

@ -0,0 +1,61 @@
package com.fr.base.i18n;
import java.awt.BorderLayout;
import java.awt.ComponentOrientation;
import java.awt.Container;
import java.awt.FlowLayout;
import java.util.Locale;
/**
* 根据国际化获取组件方向
*
* @author obo
* @since 11.0
* Created on 2024/07/17
*/
public class BidiUtils {
private static final Locale ar = new Locale("ar", "SA");
private static final Locale cn = Locale.CHINA;
private BidiUtils() {
}
public static ComponentOrientation getOrientationByLocale() {
return ComponentOrientation.getOrientation(ar);
}
public static void applyOrientationByLocale(Container component) {
component.applyComponentOrientation(ComponentOrientation.getOrientation(ar));
}
public static void applyOrientationByLocale(Container ...component) {
for (Container container : component) {
container.applyComponentOrientation(ComponentOrientation.getOrientation(ar));
}
}
public static boolean rtl() {
return ComponentOrientation.getOrientation(ar) == ComponentOrientation.RIGHT_TO_LEFT;
}
public static String getBorderLayoutWest() {
return BidiUtils.rtl() ? BorderLayout.EAST : BorderLayout.WEST;
}
public static String getBorderLayoutEast() {
return BidiUtils.rtl() ? BorderLayout.WEST : BorderLayout.EAST;
}
public static int getFlowLayoutLeft() {
return BidiUtils.rtl() ? FlowLayout.RIGHT : FlowLayout.LEFT;
}
public static int getFlowLayoutRight() {
return BidiUtils.rtl() ? FlowLayout.LEFT : FlowLayout.RIGHT;
}
public static int getStableConstantsRight() {
return BidiUtils.rtl() ? com.fr.stable.Constants.LEFT : com.fr.stable.Constants.RIGHT;
}
}

3
designer-base/src/main/java/com/fr/design/actions/UpdateAction.java

@ -6,6 +6,7 @@ package com.fr.design.actions;
import com.fr.base.NameStyle;
import com.fr.base.ScreenResolution;
import com.fr.base.Style;
import com.fr.base.i18n.BidiUtils;
import com.fr.base.svg.SVGIcon;
import com.fr.base.svg.IconUtils;
import com.fr.design.actions.core.ActionFactory;
@ -327,6 +328,7 @@ public abstract class UpdateAction extends ShortCut implements Action {
object = menuItem;
this.putValue(UIMenuItem.class.getName(), object);
menuItem.applyComponentOrientation(BidiUtils.getOrientationByLocale());
}
return (UIMenuItem) object;
}
@ -547,7 +549,6 @@ public abstract class UpdateAction extends ShortCut implements Action {
menuItem.addActionListener(action);
menuItem.setToolTipText((String) action.getValue(Action.LONG_DESCRIPTION));
menuItem.setAccelerator((KeyStroke) action.getValue(Action.ACCELERATOR_KEY));
return menuItem;
}

2
designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java

@ -1,5 +1,6 @@
package com.fr.design.actions.server;
import com.fr.base.i18n.BidiUtils;
import com.fr.data.impl.Connection;
import com.fr.design.actions.UpdateAction;
import com.fr.design.data.datapane.connect.ConnectionShowPane;
@ -118,6 +119,7 @@ public class ConnectionListAction extends UpdateAction {
menuItem.setName(getName());
setPressedIcon4Button(menuItem);
setDisabledIcon4Button(menuItem);
menuItem.applyComponentOrientation(BidiUtils.getOrientationByLocale());
object = menuItem;
this.putValue(UILockMenuItem.class.getName(), object);

3
designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java

@ -4,6 +4,7 @@
package com.fr.design.actions.server;
import com.fr.base.TableData;
import com.fr.base.i18n.BidiUtils;
import com.fr.design.DesignModelAdapter;
import com.fr.design.actions.UpdateAction;
import com.fr.design.data.DesignTableDataManager;
@ -181,7 +182,7 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS
setPressedIcon4Button(menuItem);
setDisabledIcon4Button(menuItem);
object = menuItem;
menuItem.applyComponentOrientation(BidiUtils.getOrientationByLocale());
this.putValue(UILockMenuItem.class.getName(), object);
ServerTableDataLockChangeChecker.getInstance().addEditLockChangeListener((UILockMenuItem)object);
}

7
designer-base/src/main/java/com/fr/design/data/datapane/management/search/pane/TreeSearchToolbarPane.java

@ -1,5 +1,6 @@
package com.fr.design.data.datapane.management.search.pane;
import com.fr.base.i18n.BidiUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.DesignModelAdapter;
import com.fr.design.constants.UIConstants;
@ -88,6 +89,12 @@ public class TreeSearchToolbarPane extends JPanel implements TreeSearchStatusCha
add(contentPane, BorderLayout.CENTER);
setPreferredSize(new Dimension(240, 30));
TableDataTreeSearchManager.getInstance().registerTreeSearchStatusChangeListener(this);
this.applyComponentOrientation(BidiUtils.getOrientationByLocale());
toolbar.applyComponentOrientation(BidiUtils.getOrientationByLocale());
toolbarPane.applyComponentOrientation(BidiUtils.getOrientationByLocale());
searchPane.applyComponentOrientation(BidiUtils.getOrientationByLocale());
searchTextField.applyComponentOrientation(BidiUtils.getOrientationByLocale());
contentPane.applyComponentOrientation(BidiUtils.getOrientationByLocale());
}
private void initContentPane() {

21
designer-base/src/main/java/com/fr/design/file/MultiTemplateTabMenuFactory.java

@ -1,5 +1,6 @@
package com.fr.design.file;
import com.fr.base.i18n.BidiUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
@ -17,11 +18,14 @@ import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.ComponentOrientation;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.text.Bidi;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -134,7 +138,7 @@ public class MultiTemplateTabMenuFactory {
button.setPreferredSize(new Dimension(menu.getWidth(), ITEM_SIZE));
button.setOpaque(true);
button.setBackground(UIConstants.NORMAL_BACKGROUND);
button.setHorizontalAlignment(SwingConstants.LEFT);
button.setHorizontalAlignment(BidiUtils.rtl() ? SwingConstants.RIGHT : SwingConstants.LEFT);
button.setForeground(UIConstants.FLESH_BLUE);
return button;
}
@ -193,10 +197,15 @@ public class MultiTemplateTabMenuFactory {
menuItemButtonGroup.templateButton.setForeground(UIConstants.FLESH_BLUE);
}
jPanel.add(menuItemButtonGroup.iconButton, BorderLayout.WEST);
jPanel.add(menuItemButtonGroup.templateButton, BorderLayout.CENTER);
jPanel.add(menuItemButtonGroup.closeButton, BorderLayout.EAST);
if (BidiUtils.rtl()) {
jPanel.add(menuItemButtonGroup.iconButton, BorderLayout.EAST);
jPanel.add(menuItemButtonGroup.templateButton, BorderLayout.CENTER);
jPanel.add(menuItemButtonGroup.closeButton, BorderLayout.WEST);
} else {
jPanel.add(menuItemButtonGroup.iconButton, BorderLayout.WEST);
jPanel.add(menuItemButtonGroup.templateButton, BorderLayout.CENTER);
jPanel.add(menuItemButtonGroup.closeButton, BorderLayout.EAST);
}
return jPanel;
}
@ -237,7 +246,7 @@ public class MultiTemplateTabMenuFactory {
button.setPreferredSize(new Dimension(menu.getWidth() - ITEM_SIZE * 2, ITEM_SIZE));
button.setOpaque(true);
button.setBackground(UIConstants.NORMAL_BACKGROUND);
button.setHorizontalAlignment(SwingConstants.LEFT);
button.setHorizontalAlignment(BidiUtils.rtl() ? SwingConstants.RIGHT : SwingConstants.LEFT);
return button;
}

23
designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java

@ -2,6 +2,7 @@ package com.fr.design.file;
import com.fr.base.GraphHelper;
import com.fr.base.i18n.BidiUtils;
import com.fr.base.svg.IconUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.actions.UpdateAction;
@ -67,6 +68,7 @@ import java.awt.geom.GeneralPath;
import java.awt.geom.Line2D;
import java.awt.geom.Path2D;
import java.awt.geom.RoundRectangle2D;
import java.text.Bidi;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@ -571,7 +573,8 @@ public class MultiTemplateTabPane extends JComponent {
private void showListDown() {
UIScrollPopUpMenu menu = MultiTemplateTabMenuFactory.getInstance().createMenu();
GUICoreUtils.showPopupMenu(menu, MultiTemplateTabPane.getInstance(), MultiTemplateTabPane.getInstance().getWidth() - menu.getPreferredSize().width, getY() - 1 + getHeight());
int x = BidiUtils.rtl() ? 0 : MultiTemplateTabPane.getInstance().getWidth() - menu.getPreferredSize().width;
GUICoreUtils.showPopupMenu(menu, MultiTemplateTabPane.getInstance(), x, getY() - 1 + getHeight());
}
@ -613,7 +616,7 @@ public class MultiTemplateTabPane extends JComponent {
if (selectedIndex < 0) {
selectedIndex = 0;
}
double templateStartX = 0;
double templateStartX = BidiUtils.rtl() ? maxWidth - realWidth : 0;
startX = new int[maxPaintIndex - minPaintIndex + 1];
isNeedToolTips = new boolean[maxPaintIndex - minPaintIndex + 1];
@ -651,7 +654,7 @@ public class MultiTemplateTabPane extends JComponent {
boolean isLeft = i < selectedIndex;
startX[i - minPaintIndex] = paintUnSelectedTab(g2d, icon, templateStartX, name, selectedIcon, isLeft, mouseOveredIndex, i);
}
templateStartX += realWidth;
templateStartX = BidiUtils.rtl() ? templateStartX - realWidth : templateStartX + realWidth;
}
if (!DesignerMode.isVcsMode()) {
@ -682,7 +685,7 @@ public class MultiTemplateTabPane extends JComponent {
private void paintListDown(Graphics2D g2d, double maxWidth) {
int x = (int) maxWidth + (LIST_BUTTON_WIDTH - listDownMode.getIconWidth()) / 2;
int x = BidiUtils.rtl() ? (LIST_BUTTON_WIDTH - listDownMode.getIconWidth()) / 2 : (int) maxWidth + (LIST_BUTTON_WIDTH - listDownMode.getIconWidth()) / 2;
int y = (getHeight() - listDownMode.getIconHeight()) / 2;
listDownMode.paintIcon(this, g2d, x, y);
}
@ -1126,19 +1129,23 @@ public class MultiTemplateTabPane extends JComponent {
private boolean isOverListDown(int evtX) {
int maxWidth = getWidth() - LIST_BUTTON_WIDTH;
return evtX >= (maxWidth + SMALLGAP) && evtX <= (getWidth() - SMALLGAP);
if (BidiUtils.rtl()) {
return evtX >= SMALLGAP && evtX <= (LIST_BUTTON_WIDTH - SMALLGAP);
} else {
int maxWidth = getWidth() - LIST_BUTTON_WIDTH;
return evtX >= (maxWidth + SMALLGAP) && evtX <= (getWidth() - SMALLGAP);
}
}
private int getTemplateIndex(int evtX) {
int textX = 0;
int textX = BidiUtils.rtl() ? (int) (getWidth() - LIST_BUTTON_WIDTH * 1.0D) - realWidth : 0;
for (int i = minPaintIndex; i <= maxPaintIndex; i++) {
int textWidth = showJTemplateTab(openedTemplate.get(i)) ? realWidth : 0;
if (evtX >= textX && evtX < textX + textWidth) {
return i;
}
textX += textWidth;
textX = BidiUtils.rtl() ? textX - textWidth : textX + textWidth;
}
return -1;
}

17
designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java

@ -1,6 +1,7 @@
package com.fr.design.gui.icontainer;
import com.fr.base.i18n.BidiUtils;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton;
@ -177,13 +178,19 @@ public class UIEastResizableContainer extends JPanel {
if (topToolPane == null || rightPane == null) {
return;
}
// topToolPane.setBounds(0, 0, containerWidth, topToolPaneHeight);//0,0,10,462
topToolPane.setBounds(0, 0, leftPaneWidth, topToolPaneHeight);//0,0,10,462
leftPane.setBounds(0, topToolPaneHeight, leftPaneWidth, getHeight() - topToolPaneHeight);
if (BidiUtils.rtl()) {
topToolPane.setBounds(containerWidth - leftPaneWidth, 0, leftPaneWidth, topToolPaneHeight);
leftPane.setBounds(containerWidth - leftPaneWidth, topToolPaneHeight, leftPaneWidth, getHeight() - topToolPaneHeight);
rightPane.setBounds(0, 0, containerWidth - leftPaneWidth, getHeight());
} else {
// topToolPane.setBounds(0, 0, containerWidth, topToolPaneHeight);//0,0,10,462
topToolPane.setBounds(0, 0, leftPaneWidth, topToolPaneHeight);//0,0,10,462
leftPane.setBounds(0, topToolPaneHeight, leftPaneWidth, getHeight() - topToolPaneHeight);
// parameterPane.setBounds(20, 0, 230, getParameterPaneHeight());//10,0,230,462
rightPane.setBounds(leftPaneWidth, 0, containerWidth - leftPaneWidth, getHeight());//20,0,230,0
rightPane.setBounds(leftPaneWidth, 0, containerWidth - leftPaneWidth, getHeight());//20,0,230,0
}
}
@Override

51
designer-base/src/main/java/com/fr/design/gui/ilable/LocaleOrientationLabel.java

@ -0,0 +1,51 @@
package com.fr.design.gui.ilable;
import com.fr.base.i18n.BidiUtils;
import javax.swing.Icon;
import javax.swing.JLabel;
/**
* description
*
* @author obo
* @since 11.0
* Created on 2024/07/16
*/
public class LocaleOrientationLabel extends JLabel {
public LocaleOrientationLabel(String text, Icon image, int horizontalAlignment) {
super(text, image, horizontalAlignment);
if (image != null && text != null) {
setIconTextGap(4);
}
this.setComponentOrientation(BidiUtils.getOrientationByLocale());
}
public LocaleOrientationLabel(String text, int horizontalAlignment) {
super(text, horizontalAlignment);
this.setComponentOrientation(BidiUtils.getOrientationByLocale());
}
public LocaleOrientationLabel(String text) {
super(text);
this.setComponentOrientation(BidiUtils.getOrientationByLocale());
}
public LocaleOrientationLabel(Icon image, int horizontalAlignment) {
super(image, horizontalAlignment);
this.setComponentOrientation(BidiUtils.getOrientationByLocale());
}
public LocaleOrientationLabel(Icon image) {
super(image);
this.setComponentOrientation(BidiUtils.getOrientationByLocale());
}
public LocaleOrientationLabel() {
super();
this.setComponentOrientation(BidiUtils.getOrientationByLocale());
}
}

3
designer-base/src/main/java/com/fr/design/gui/ilable/UILabel.java

@ -6,7 +6,6 @@ import com.fr.stable.StringUtils;
import javax.swing.Icon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Color;
@ -19,7 +18,7 @@ import java.awt.Dimension;
* Date: 13-1-23
* Time: 下午3:15
*/
public class UILabel extends JLabel implements UITextComponent {
public class UILabel extends LocaleOrientationLabel implements UITextComponent {
private static final int HTML_SHIFT_HEIGHT = 3;
public UILabel(String text, Icon image, int horizontalAlignment) {

12
designer-base/src/main/java/com/fr/design/gui/imenu/UIMenuItemUI.java

@ -1,5 +1,6 @@
package com.fr.design.gui.imenu;
import com.fr.base.i18n.BidiUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.stable.Constants;
@ -34,16 +35,17 @@ public class UIMenuItemUI extends BasicMenuItemUI {
g.setColor(UIConstants.NORMAL_BACKGROUND);
g.fillRect(0, 0, menuWidth, menuHeight);
int bidiX = BidiUtils.rtl() ? 10 : 30;
int bidiWidth = BidiUtils.rtl() ? menuWidth - 35 : menuWidth - 30;
if (menuItem.isOpaque()) {
if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) {
GUIPaintUtils.fillPaint((Graphics2D) g, 30, 0, menuWidth - 30, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7);
GUIPaintUtils.fillPaint((Graphics2D) g, bidiX, 0, bidiWidth, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7);
} else {
GUIPaintUtils.fillPaint((Graphics2D) g, 30, 0, menuWidth - 30, menuHeight, true, Constants.NULL, menuItem.getBackground(), 7);
GUIPaintUtils.fillPaint((Graphics2D) g, bidiX, 0, bidiWidth, menuHeight, true, Constants.NULL, menuItem.getBackground(), 7);
}
g.setColor(oldColor);
} else if (model.isArmed() || (menuItem instanceof JMenu &&
model.isSelected())) {
GUIPaintUtils.fillPaint((Graphics2D) g, 30, 0, menuWidth - 30, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7);
} else if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) {
GUIPaintUtils.fillPaint((Graphics2D) g, bidiX, 0, bidiWidth, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7);
g.setColor(oldColor);
}
}

17
designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe;
import com.fr.base.i18n.BidiUtils;
import com.fr.design.DesignState;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.constants.UIConstants;
@ -81,7 +82,7 @@ public class CenterRegionContainerPane extends JPanel {
};
toolbarPane.setLayout(FRGUIPaneFactory.createBorderLayout());
eastPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
eastPane.add(largeToolbar = getToolBarMenuDock().createLargeToolbar(), BorderLayout.WEST);
eastPane.add(largeToolbar = getToolBarMenuDock().createLargeToolbar(), BidiUtils.getBorderLayoutEast());
eastCenterPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
combineUpTooBar();
eastCenterPane.add(combineUp, BorderLayout.NORTH);
@ -108,9 +109,12 @@ public class CenterRegionContainerPane extends JPanel {
* 创建上工具栏
*/
private void combineUpTooBar() {
combineUp = new UIToolbar(FlowLayout.LEFT);
// combineUp = new UIToolbar(BidiUtils.getFlowLayoutLeft());
// combineUp.setBorder(new MatteBorder(new Insets(0, LEFT_ALIGN_GAP, 1, 0), UIConstants.LINE_COLOR));
// combineUp.setLayout(new FlowLayout(BidiUtils.getFlowLayoutLeft(), 5, 2));
combineUp = new UIToolbar(BidiUtils.getFlowLayoutLeft());
combineUp.setBorder(new MatteBorder(new Insets(0, LEFT_ALIGN_GAP, 1, 0), UIConstants.LINE_COLOR));
combineUp.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 2));
combineUp.setLayout(new FlowLayout(BidiUtils.getFlowLayoutLeft(), 5, 2));
setUpUpToolBar(null);
}
@ -229,7 +233,7 @@ public class CenterRegionContainerPane extends JPanel {
}
// 颜色,字体那些按钮的工具栏
toolbarPane.add(toolbarComponent = ad.resetToolBar(toolbarComponent, plus), BorderLayout.CENTER);
toolbarPane.add(toolbarComponent = ad.resetToolBar(toolbarComponent, plus), BidiUtils.rtl() ? BorderLayout.EAST : BorderLayout.CENTER);
JPanel customNorthPane = strategy.customNorthPane(toolbarPane,plus);
if (!isExist(customNorthPane)){
this.removeNorth();
@ -275,9 +279,8 @@ public class CenterRegionContainerPane extends JPanel {
//移除新建模板按钮
templateTabPane.remove(newWorkBookPane);
} else {
eastPane.add(largeToolbar, BorderLayout.WEST);
templateTabPane.add(newWorkBookPane, BorderLayout.WEST);
eastPane.add(largeToolbar, BidiUtils.getBorderLayoutWest());
templateTabPane.add(newWorkBookPane, BidiUtils.getBorderLayoutWest());
}
}

12
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -5,6 +5,7 @@ package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.base.OptimizeUtil;
import com.fr.base.i18n.BidiUtils;
import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
@ -266,7 +267,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
basePane.add(CenterRegionContainerPane.getInstance(), BorderLayout.CENTER);
laoyoutWestPane();
basePane.add(EastRegionContainerPane.getInstance(), BorderLayout.EAST);
basePane.add(EastRegionContainerPane.getInstance(), BidiUtils.getBorderLayoutEast());
basePane.setBounds(0, 0, contentWidth, contentHeight);
// 数值越小。越在底层
@ -310,6 +311,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
this.setDropTarget(new DropTarget(this, DnDConstants.ACTION_MOVE, new FileDropTargetListener(), true));
closeMode = UIConstants.CLOSE_OF_AUTHORITY;
initMenuPane();
BidiUtils.applyOrientationByLocale(this);
}
public void resizeFrame() {
@ -477,7 +479,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
protected void laoyoutWestPane() {
basePane.add(WestRegionContainerPane.getInstance(), BorderLayout.WEST);
basePane.add(WestRegionContainerPane.getInstance(), BidiUtils.getBorderLayoutWest());
}
// 调整windows大小
@ -820,7 +822,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
DesignerOpenEmptyPanel designerOpenEmptyPanel = new DesignerOpenEmptyPanel();
BorderLayout layout = (BorderLayout) basePane.getLayout();
basePane.remove(layout.getLayoutComponent(BorderLayout.CENTER));
basePane.remove(layout.getLayoutComponent(BorderLayout.EAST));
basePane.remove(layout.getLayoutComponent(BidiUtils.getBorderLayoutEast()));
basePane.add(designerOpenEmptyPanel, BorderLayout.CENTER);
resetToolkitByPlus(ToolBarMenuDock.NULLAVOID);
@ -974,10 +976,10 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
basePane.add(center, BorderLayout.CENTER);
}
if (west != null) {
basePane.add(west, BorderLayout.WEST);
basePane.add(west, BidiUtils.getBorderLayoutWest());
}
if (east != null) {
basePane.add(east, BorderLayout.EAST);
basePane.add(east, BidiUtils.getBorderLayoutEast());
}
jTemplate.setComposite();

4
designer-base/src/main/java/com/fr/design/mainframe/NorthRegionContainerPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe;
import com.fr.base.i18n.BidiUtils;
import com.fr.design.DesignState;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager;
@ -67,7 +68,7 @@ public class NorthRegionContainerPane extends JPanel {
this.setLayout(new BorderLayout());
this.add(new UIMenuHighLight(), BorderLayout.SOUTH);
this.add(initNorthEastPane(ad), BorderLayout.EAST);
this.add(initNorthEastPane(ad), BidiUtils.rtl() ? BorderLayout.WEST : BorderLayout.EAST);
}
/**
@ -180,6 +181,7 @@ public class NorthRegionContainerPane extends JPanel {
MenuManager.getInstance().setMenus4Designer(designState);
if (menuBar == null) {
this.add(menuBar = ad.createJMenuBar(plus), BorderLayout.CENTER);
menuBar.applyComponentOrientation(BidiUtils.getOrientationByLocale());
} else {
ad.resetJMenuBar(menuBar, plus);
}

4
designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe;
import com.fr.base.i18n.BidiUtils;
import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignerEnvManager;
import com.fr.design.constants.UIConstants;
@ -11,7 +12,6 @@ import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.stable.Constants;
public class WestRegionContainerPane extends UIResizableContainer {
@ -31,7 +31,7 @@ public class WestRegionContainerPane extends UIResizableContainer {
}
public WestRegionContainerPane() {
super(DesignerFrameFileDealerPane.getInstance(), Constants.RIGHT);
super(DesignerFrameFileDealerPane.getInstance(), BidiUtils.getStableConstantsRight());
setDownPane(TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));

2
designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogMessageBar.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.loghandler;
import com.fr.base.i18n.BidiUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ilable.UILabel;
import com.fr.stable.StringUtils;
@ -52,6 +53,7 @@ public class LogMessageBar extends JPanel {
return;
}
dlg = new LogDetailPane().showDialog();
dlg.applyComponentOrientation(BidiUtils.getOrientationByLocale());
dlg.setVisible(true);
}
});

4
designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pane/TemplateTreeSearchToolbarPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.manager.search.searcher.control.pane;
import com.fr.base.i18n.BidiUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.search.event.TreeSearchStatusChangeEvent;
@ -132,6 +133,7 @@ public class TemplateTreeSearchToolbarPane extends JPanel implements TreeSearchS
searchPane.add(searchLabel, BorderLayout.WEST);
searchPane.add(searchTextField, BorderLayout.CENTER);
searchPane.add(returnLabel, BorderLayout.EAST);
searchPane.applyComponentOrientation(BidiUtils.getOrientationByLocale());
}
private void initSearchTextField() {
@ -171,6 +173,7 @@ public class TemplateTreeSearchToolbarPane extends JPanel implements TreeSearchS
}
});
this.searchTextField.addKeyListener(enterPressed);
searchTextField.applyComponentOrientation(BidiUtils.getOrientationByLocale());
}
private void dealWithTextChange() {
@ -185,6 +188,7 @@ public class TemplateTreeSearchToolbarPane extends JPanel implements TreeSearchS
toolbarPane = new JPanel();
toolbarPane.setLayout(FRGUIPaneFactory.createBorderLayout());
toolbarPane.add(toolbar, BorderLayout.CENTER);
toolbarPane.applyComponentOrientation(BidiUtils.getOrientationByLocale());
}
/**

3
designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -4,6 +4,7 @@
package com.fr.design.mainframe.toolbar;
import com.fr.base.FRContext;
import com.fr.base.i18n.BidiUtils;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignState;
import com.fr.design.DesignerEnvManager;
@ -62,7 +63,6 @@ import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.os.impl.SupportOSImpl;
import com.fr.design.remote.action.RemoteDesignAuthManagerAction;
import com.fr.design.update.actions.SoftwareUpdateAction;
@ -219,6 +219,7 @@ public abstract class ToolBarMenuDock {
}
};
resetJMenuBar(jMenuBar, plus);
jMenuBar.applyComponentOrientation(BidiUtils.getOrientationByLocale());
return jMenuBar;
}

5
designer-base/src/main/java/com/fr/design/menu/MenuDef.java

@ -1,5 +1,6 @@
package com.fr.design.menu;
import com.fr.base.i18n.BidiUtils;
import com.fr.base.svg.IconUtils;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.ibutton.UIButton;
@ -240,7 +241,7 @@ public class MenuDef extends ShortCut {
createdJMenu.getPopupMenu().addContainerListener(listener);
}
}
createdJMenu.applyComponentOrientation(BidiUtils.getOrientationByLocale());
return createdJMenu;
}
@ -254,6 +255,7 @@ public class MenuDef extends ShortCut {
} else {
createdJMenu = new UIMenu(this.getName());
}
createdJMenu.applyComponentOrientation(BidiUtils.getOrientationByLocale());
return createdJMenu;
}
@ -490,6 +492,7 @@ public class MenuDef extends ShortCut {
MenuDef.this.updatePopupMenu(popupMenu);
GUICoreUtils.showPopupMenu(popupMenu, button, 0, button.getSize().height);
}
popupMenu.applyComponentOrientation(BidiUtils.getOrientationByLocale());
}
};

3
designer-base/src/main/java/com/fr/design/menu/ToolBarDef.java

@ -1,5 +1,6 @@
package com.fr.design.menu;
import com.fr.base.i18n.BidiUtils;
import com.fr.design.actions.UpdateAction;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.itoolbar.UIToolBarUI;
@ -43,7 +44,7 @@ public class ToolBarDef {
* 一个static的方法生成一个JToolBar
*/
public static UIToolbar createJToolBar() {
UIToolbar toolbar = new UIToolbar(FlowLayout.LEFT);
UIToolbar toolbar = new UIToolbar(BidiUtils.getFlowLayoutLeft());
toolbar.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0));
return toolbar;
}

Loading…
Cancel
Save