@Override
      public void actionPerformed(ActionEvent e) {
        putValue(Action.NAME, myMode.getName());

        dimensionService.setSize(getPrivateDimensionKey(), getSize());

        setMode(myMode.other());
        final Dimension size = dimensionService.getSize(getPrivateDimensionKey());
        if (size != null) {
          setSize(size.width, size.height);
          validate();
        }
        else {
          pack();
        }
      }
@Override
      public void actionPerformed(ActionEvent e)