当前位置: 首页>>代码示例>>Java>>正文


Java OverlayLayout类代码示例

本文整理汇总了Java中javax.swing.OverlayLayout的典型用法代码示例。如果您正苦于以下问题:Java OverlayLayout类的具体用法?Java OverlayLayout怎么用?Java OverlayLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OverlayLayout类属于javax.swing包,在下文中一共展示了OverlayLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: InformationPanel

import javax.swing.OverlayLayout; //导入依赖的package包/类
/**
 * Create a new InformationPanel.
 */
InformationPanel() {
	setLayout(new OverlayLayout(this));
	JComponent container = SBoxLayout.createContainer(SBoxLayout.VERTICAL);
	glassPane = new JComponent(){};
	add(glassPane);
	add(container);
	
	// ** Zone name **
	nameField = new JTextPane();
	StyleConstants.setAlignment(center, StyleConstants.ALIGN_CENTER);
	nameField.setAlignmentX(CENTER_ALIGNMENT);
	nameField.setOpaque(true);
	nameField.setBackground(getBackground());
	nameField.setForeground(Color.WHITE);
	nameField.setFocusable(false);
	nameField.setEditable(false);
	container.add(nameField, SLayout.EXPAND_X);
	
	// ** Danger display **
	dangerIndicator = new DangerIndicator(MAX_SKULLS);
	dangerIndicator.setAlignmentX(CENTER_ALIGNMENT);
	container.add(dangerIndicator);
	// Default to safe, so that we always have a tooltip
	describeDanger(0);
}
 
开发者ID:arianne,项目名称:stendhal,代码行数:29,代码来源:InformationPanel.java

示例2: MainContainer

import javax.swing.OverlayLayout; //导入依赖的package包/类
/**
 * OliviaWindowから生成.
 * @param mw OliviaWindowのインスタンス
 */
public MainContainer(OliviaWindow mw) {
    this.contentPanel = new ContentView();
    this.statusBar = new StatusBar();
    this.sideBar = new SideBar(Olivia.getProjects().getCurrentProject(), mw);
    this.setLayout(new OverlayLayout(this));
    
    BorderPanel main = new BorderPanel();
    main.add(sideBar, BorderLayout.WEST);
    main.add(contentPanel, BorderLayout.CENTER);
    main.add(statusBar, BorderLayout.SOUTH);
    
    this.add(new OverlayContainer());
    this.add(main);
    
}
 
开发者ID:tohhy,项目名称:olivia-swing,代码行数:20,代码来源:MainContainer.java

示例3: OverlayPanel

import javax.swing.OverlayLayout; //导入依赖的package包/类
public OverlayPanel(JComponent overlay, String text) {
    OverlayLayout layout = new OverlayLayout(this);
    this.setLayout(layout);

    label = new JLabel(text);
    label.setFont(new Font(label.getFont().getName(), Font.ITALIC, 18));
    label.setForeground(new Color(224, 220, 220));
    label.setLocation(0, 0);

    JScrollPane scroller = new JScrollPane(overlay);
    scroller.setLocation(0, 0);
    scroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

    add(label);
    add(scroller);
}
 
开发者ID:JabRef,项目名称:jabref,代码行数:17,代码来源:OverlayPanel.java

示例4: NerfableInternalFrame

import javax.swing.OverlayLayout; //导入依赖的package包/类
public NerfableInternalFrame(String title, boolean resizable, boolean closable, boolean maximizable, boolean iconifiable) {
  super();
  super.setTitle(title);
  super.setResizable(resizable);
  super.setClosable(closable);
  super.setMaximizable(maximizable);
  super.setIconifiable(iconifiable);

  JPanel realContentPane = new JPanel(new BorderLayout());
    JPanel overlayPanel = new JPanel();
      overlayPanel.setLayout(new OverlayLayout(overlayPanel));
      realContentPane.add(overlayPanel);

    glassPane = new NerfableGlassPane();
      overlayPanel.add(glassPane);

    contentPaneHolder.add(new JPanel());
      overlayPanel.add(contentPaneHolder);

    contentPaneHolder.add(contentPane);

  super.setContentPane(realContentPane);
}
 
开发者ID:Vhati,项目名称:ArcanistCCG,代码行数:24,代码来源:NerfableInternalFrame.java

示例5: getOverlayLayoutConstructor

import javax.swing.OverlayLayout; //导入依赖的package包/类
private static Constructor getOverlayLayoutConstructor() {
    if (overlayLayoutConstructor == null) {
        try {
            overlayLayoutConstructor = OverlayLayout.class.getConstructor(
                                       new Class[] { Container.class });
        } catch (NoSuchMethodException ex) { // should not happen
            Exceptions.printStackTrace(ex);
        }
    }
    return overlayLayoutConstructor;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:OverlayLayoutSupport.java

示例6: makePreviewTable

import javax.swing.OverlayLayout; //导入依赖的package包/类
/**
 * Fills the tablePane with content.
 */
private JComponent makePreviewTable() {
	previewTable = new ExtendedJTable(false, false, false);
	// ensure same background as JPanels in case of only few rows
	previewTable.setBackground(Colors.PANEL_BACKGROUND);
	previewTable.setColoredTableCellRenderer(new ColoredTableCellRenderer() {

		private final Font boldFont = getFont().deriveFont(Font.BOLD);

		@Override
		public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus,
				int row, int column) {
			JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
			adjustCell(row, label, boldFont);
			return label;
		}

	});

	loadingContentPane = new LoadingContentPane("loading_data", previewTable);

	tablePane = new JScrollPane(loadingContentPane);
	tablePane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
	tablePane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
	tablePane.setBorder(null);

	// add PREVIEW label in front of scrollpane
	JLayeredPane layeredPane = new JLayeredPane();
	layeredPane.setLayout(new OverlayLayout(layeredPane));
	layeredPane.add(tablePane, JLayeredPane.DEFAULT_LAYER);

	JPanel overlayPanel = new JPanel(new BorderLayout());
	overlayPanel.setOpaque(false);
	overlayLabel = new JLabel("", SwingConstants.CENTER);
	showPreviewLettering();
	overlayPanel.add(overlayLabel, BorderLayout.CENTER);

	layeredPane.add(overlayPanel, JLayeredPane.PALETTE_LAYER);
	return layeredPane;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:43,代码来源:CSVFormatSpecificationPanel.java

示例7: createFrame

import javax.swing.OverlayLayout; //导入依赖的package包/类
private void createFrame() {
        jframe = new JFrame("Test");
        jframe.setName("MainWindow");
        jframe.setSize(width, height);
        jframe.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        jframe.setUndecorated(false);
//        jframe.setBackground(new Color(0,0,0,0f));
//        jframe.add(SwingUtils.createCanvas());
//        jfxWindow = createJfxWindow(jframe);

        OverlayLayout layout = new OverlayLayout(jframe);
        
        
        
        JPanel jp1 = new TranslucentPane();
        jp1.setSize(width, (int) (height * 0.5));
        jp1.setBackground(new Color(0,0,0,0));
        jp1.add(new JButton("1111"));
//        jp1.setOpaque(false);
        
        JPanel jp2 = new JPanel();
        jp2.setSize(width, height);
//        jp2.setBackground(new Color(0,0,0,0.1f));
        jp2.add(new JButton("22222222222222"));
        jp2.add(SwingUtils.createCanvas());
        
        
        jframe.add(jp1);
        jframe.add(jp2);

    }
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:32,代码来源:TestLayered.java

示例8: createTabs

import javax.swing.OverlayLayout; //导入依赖的package包/类
private static void createTabs(){
        rootPanel = new JPanel();
//        canvasPanel.setSize(640, 480);
//        canvasPanel.add(canvas);
//        frame.setSize(640, 480);

        
        frame.getContentPane().add(rootPanel);
        OverlayLayout layout = new OverlayLayout(rootPanel);
//        BorderLayout layout = new BorderLayout(1, 1);
        
        JFXPanel jfxPanel = new JFXPanel();
        jfxPanel.setBounds(0, 0, 100, 100);
        jfxPanel.setSize(100, 100);
        
        rootPanel.setLayout(layout);
//        rootPanel.add(jfxPanel);
        rootPanel.add(new JButton("fsfdsfj;dsj;fjds;jfasf;afja;fd"));
        rootPanel.add(canvas);
        
        Platform.runLater(() -> {
            Button btn = new Button("Hello JFX!");
            StackPane root = new StackPane();
            root.setBackground(Background.EMPTY);
            root.getChildren().add(btn);
//            root.setStyle("-fx-background-color: transparent;");
//            root.setStyle("-fx-background-color:#0000FF;");
            
            Scene scene = new Scene(root);
            scene.setFill(Color.TRANSPARENT);
            
            Stage stage = new Stage();
            stage.initStyle(StageStyle.TRANSPARENT);
            stage.setScene(scene);
            stage.show();
        });
    }
 
开发者ID:huliqing,项目名称:LuoYing,代码行数:38,代码来源:TestSwing.java

示例9: LabeledProgressBar

import javax.swing.OverlayLayout; //导入依赖的package包/类
public LabeledProgressBar() {

	setLayout(new OverlayLayout(this));

	label = new JLabel();
	label.setAlignmentX(0.5f);
	label.setFont(label.getFont().deriveFont(11f));
	add(label);

	progressBar = new JProgressBar(0, 100);
	progressBar.setBorderPainted(false);
	add(progressBar);

    }
 
开发者ID:mzmine,项目名称:mzmine2,代码行数:15,代码来源:LabeledProgressBar.java

示例10: addLayeredValidator

import javax.swing.OverlayLayout; //导入依赖的package包/类
private void addLayeredValidator() {
    validator = new Validator();
    
    JLayeredPane layeredPane = getRootPane().getLayeredPane();
    layeredPane.setLayout(new OverlayLayout(layeredPane));
    layeredPane.add(validator, (Integer) (JLayeredPane.DEFAULT_LAYER + 50));
    //validator.setBounds(0, 0, getWidth(), getHeight());
}
 
开发者ID:romainguy,项目名称:filthy-rich-clients,代码行数:9,代码来源:ApplicationFrame.java

示例11: createComponents

import javax.swing.OverlayLayout; //导入依赖的package包/类
private void createComponents() {
    this.pannelloPrincipale = new javax.swing.JPanel();
    this.pannelloPrincipale.setLayout(new java.awt.BorderLayout());
    this.glassPane = new GraphSceneGlassPane();
    this.intermediatePanel = new JPanel();
    this.intermediatePanel.setName(Costanti.INTERMEDIE);
    this.intermediatePanel.setLayout(new AbsoluteLayout());
    this.intermediatePanel.setBackground(Costanti.getIntermediateColor());

    this.scrollSource = new JScrollPane();
    this.scrollSource.setMinimumSize(new Dimension(200, getHeight()));
    this.splitChild = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, scrollSource, intermediatePanel);
    //this.splitChild.setOneTouchExpandable(true);

    this.scrollTarget = new JScrollPane();
    this.scrollTarget.setMinimumSize(new Dimension(200, getHeight()));
    this.split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, this.getSplitChild(), scrollTarget);

    this.pannelloPrincipale.setOpaque(false);
    this.glassPane.setOpaque(false);
    this.setOpaque(false);

    OverlayLayout overlaylayout = new OverlayLayout(this);
    this.setLayout(overlaylayout);

    this.add(this.glassPane);
    this.add(this.pannelloPrincipale);
    this.pannelloPrincipale.add(getSplit());

    setSplitPane();
    initMouseListener();
}
 
开发者ID:dbunibas,项目名称:spicy,代码行数:33,代码来源:JLayeredPaneCorrespondences.java

示例12: MapBean

import javax.swing.OverlayLayout; //导入依赖的package包/类
public MapBean(boolean useThreadedNotification) {
   if (logger.isLoggable(Level.FINE)) {
      debugmsg("MapBean()");
   }
   if (!suppressCopyright) {
      Debug.output(copyrightNotice);
   }

   background = DEFAULT_BACKGROUND_COLOR;

   // Don't need one for every MapBean, just the first one.
   suppressCopyright = true;

   super.setLayout(new OverlayLayout(this));
   projectionSupport = new ProjectionSupport(this, useThreadedNotification);
   addComponentListener(this);
   addContainerListener(this);

   // ----------------------------------------
   // In a builder tool it seems that the OverlayLayout
   // makes the MapBean fail to resize. And since it has
   // no children by default, it has no size. So I add
   // a null Layer here to give it a default size.
   // ----------------------------------------
   if (java.beans.Beans.isDesignTime()) {
      add(new Layer() {
         public void projectionChanged(ProjectionEvent e) {
         }

         public Dimension getPreferredSize() {
            return new Dimension(100, 100);
         }
      });
   }

   setPreferredSize(new Dimension(projection.getWidth(), projection.getHeight()));

   DEBUG_TIMESTAMP = logger.isLoggable(Level.FINER);
   DEBUG_THREAD = logger.isLoggable(Level.FINER);
}
 
开发者ID:d2fn,项目名称:passage,代码行数:41,代码来源:MapBean.java

示例13: JSketchCanvas

import javax.swing.OverlayLayout; //导入依赖的package包/类
public JSketchCanvas()
{
	setLayout(new OverlayLayout(this));
	
	background = new BackgroundImagePanel();
	add(background, 0);
	
	drawPanel = new JDrawPanel();
	add(drawPanel, 0);
}
 
开发者ID:jorditost,项目名称:Scribbling,代码行数:11,代码来源:JSketchCanvas.java

示例14: TrackGroup

import javax.swing.OverlayLayout; //导入依赖的package包/类
public TrackGroup(GBrowserView view) {
      this.view = view;
      component.setLayout(new GridBagLayout());    
      component.setInheritsPopupMenu(true);
      //Usually track fills the whole track group and listen for these events. 
      //When the height of the settings panel exceeds the height of the tracks, also the 
      //TrackGroup becomes visible and has to listen for events.
      component.addMouseListener(getView());
      component.addMouseMotionListener(getView());
      component.addMouseWheelListener(getView());
      
      component.setBackground(Color.white);     
      
component.setLayout(new OverlayLayout(component));				

trackLayer = new JPanel();
settingsLayer = new JPanel();

trackLayer.setInheritsPopupMenu(true);
settingsLayer.setInheritsPopupMenu(true);

//First component added is the topmost when drawn
component.add(settingsLayer);
component.add(trackLayer); 		

trackLayer.setLayout(new MigLayout("flowy, fillx, gap 0! 0!, insets 0"));
settingsLayer.setLayout(new MigLayout("gap 0! 0!, insets 0"));

settingsLayer.setOpaque(false);		
trackLayer.setBackground(Color.white);			
  }
 
开发者ID:chipster,项目名称:chipster,代码行数:32,代码来源:TrackGroup.java

示例15: getSupportedClass

import javax.swing.OverlayLayout; //导入依赖的package包/类
/** Gets the supported layout manager class - OverlayLayout.
 * @return the class supported by this delegate
 */
@Override
public Class getSupportedClass() {
    return OverlayLayout.class;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:OverlayLayoutSupport.java


注:本文中的javax.swing.OverlayLayout类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。