Java 类com.intellij.uiDesigner.shared.XYLayoutManager 实例源码

项目:intellij-ce-playground    文件:LwContainer.java   
protected LayoutManager createInitialLayout(){
  return new XYLayoutManager();
}
项目:intellij-ce-playground    文件:LwContainer.java   
public final boolean isXY(){
  return getLayout() instanceof XYLayoutManager;
}
项目:intellij-ce-playground    文件:XYLayoutSerializer.java   
void readLayout(Element element, LwContainer container) {
  container.setLayout(new XYLayoutManager());
}
项目:intellij-ce-playground    文件:GridBuildUtil.java   
public static void breakGrid(final GuiEditor editor) {
  final ArrayList<RadComponent> selection = FormEditingUtil.getSelectedComponents(editor);
  if (selection.size() != 1){
    return;
  }
  if (!(selection.get(0) instanceof RadContainer)) {
    return;
  }
  final RadContainer container = (RadContainer)selection.get(0);
  if (
    container instanceof RadScrollPane ||
    container instanceof RadSplitPane ||
    container instanceof RadTabbedPane
  ){
    return;
  }

  final RadContainer parent = container.getParent();

  if (parent instanceof RadRootContainer) {
    editor.getRootContainer().setMainComponentBinding(container.getBinding());
  }

  // XY can be broken only if its parent is also XY.
  // In other words, breaking of XY is a deletion of unnecessary intermediate panel
  if (container.isXY() && !parent.isXY()) {
    return;
  }

  if (parent != null && parent.isXY()) {
    // parent is XY
    // put the contents of the container into 'parent' and remove 'container'

    final int dx = container.getX();
    final int dy = container.getY();

    while (container.getComponentCount() > 0) {
      final RadComponent component = container.getComponent(0);
      component.shift(dx, dy);
      parent.addComponent(component);
    }

    parent.removeComponent(container);
  }
  else {
    // container becomes XY
    final XYLayoutManager xyLayout = new XYLayoutManagerImpl();
    container.setLayout(xyLayout);
    xyLayout.setPreferredSize(container.getSize());
  }

  editor.refreshAndSave(true);
}
项目:intellij-ce-playground    文件:RadContainer.java   
public final boolean isXY() {
  return getLayout() instanceof XYLayoutManager;
}
项目:tools-idea    文件:LwContainer.java   
protected LayoutManager createInitialLayout(){
  return new XYLayoutManager();
}
项目:tools-idea    文件:LwContainer.java   
public final boolean isXY(){
  return getLayout() instanceof XYLayoutManager;
}
项目:tools-idea    文件:XYLayoutSerializer.java   
void readLayout(Element element, LwContainer container) {
  container.setLayout(new XYLayoutManager());
}
项目:tools-idea    文件:GridBuildUtil.java   
public static void breakGrid(final GuiEditor editor) {
  final ArrayList<RadComponent> selection = FormEditingUtil.getSelectedComponents(editor);
  if (selection.size() != 1){
    return;
  }
  if (!(selection.get(0) instanceof RadContainer)) {
    return;
  }
  final RadContainer container = (RadContainer)selection.get(0);
  if (
    container instanceof RadScrollPane ||
    container instanceof RadSplitPane ||
    container instanceof RadTabbedPane
  ){
    return;
  }

  final RadContainer parent = container.getParent();

  if (parent instanceof RadRootContainer) {
    editor.getRootContainer().setMainComponentBinding(container.getBinding());
  }

  // XY can be broken only if its parent is also XY.
  // In other words, breaking of XY is a deletion of unnecessary intermediate panel
  if (container.isXY() && !parent.isXY()) {
    return;
  }

  if (parent != null && parent.isXY()) {
    // parent is XY
    // put the contents of the container into 'parent' and remove 'container'

    final int dx = container.getX();
    final int dy = container.getY();

    while (container.getComponentCount() > 0) {
      final RadComponent component = container.getComponent(0);
      component.shift(dx, dy);
      parent.addComponent(component);
    }

    parent.removeComponent(container);
  }
  else {
    // container becomes XY
    final XYLayoutManager xyLayout = new XYLayoutManagerImpl();
    container.setLayout(xyLayout);
    xyLayout.setPreferredSize(container.getSize());
  }

  editor.refreshAndSave(true);
}
项目:tools-idea    文件:RadContainer.java   
public final boolean isXY() {
  return getLayout() instanceof XYLayoutManager;
}
项目:consulo-ui-designer    文件:GridBuildUtil.java   
public static void breakGrid(final GuiEditor editor) {
  final ArrayList<RadComponent> selection = FormEditingUtil.getSelectedComponents(editor);
  if (selection.size() != 1){
    return;
  }
  if (!(selection.get(0) instanceof RadContainer)) {
    return;
  }
  final RadContainer container = (RadContainer)selection.get(0);
  if (
    container instanceof RadScrollPane ||
    container instanceof RadSplitPane ||
    container instanceof RadTabbedPane
  ){
    return;
  }

  final RadContainer parent = container.getParent();

  if (parent instanceof RadRootContainer) {
    editor.getRootContainer().setMainComponentBinding(container.getBinding());
  }

  // XY can be broken only if its parent is also XY.
  // In other words, breaking of XY is a deletion of unnecessary intermediate panel
  if (container.isXY() && !parent.isXY()) {
    return;
  }

  if (parent != null && parent.isXY()) {
    // parent is XY
    // put the contents of the container into 'parent' and remove 'container'

    final int dx = container.getX();
    final int dy = container.getY();

    while (container.getComponentCount() > 0) {
      final RadComponent component = container.getComponent(0);
      component.shift(dx, dy);
      parent.addComponent(component);
    }

    parent.removeComponent(container);
  }
  else {
    // container becomes XY
    final XYLayoutManager xyLayout = new XYLayoutManagerImpl();
    container.setLayout(xyLayout);
    xyLayout.setPreferredSize(container.getSize());
  }

  editor.refreshAndSave(true);
}
项目:consulo-ui-designer    文件:RadContainer.java   
public final boolean isXY() {
  return getLayout() instanceof XYLayoutManager;
}