From 1f08fd456280014f3e70637034ac7117dad2a6c0 Mon Sep 17 00:00:00 2001 From: bancika Date: Tue, 31 Mar 2020 16:29:43 +0200 Subject: [PATCH] add license info and comment --- .../org/diylc/swing/gui/CollapsiblePanel.java | 35 ++++++++++++++++--- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/diylc/diylc-swing/src/org/diylc/swing/gui/CollapsiblePanel.java b/diylc/diylc-swing/src/org/diylc/swing/gui/CollapsiblePanel.java index 8557e643..215d6529 100644 --- a/diylc/diylc-swing/src/org/diylc/swing/gui/CollapsiblePanel.java +++ b/diylc/diylc-swing/src/org/diylc/swing/gui/CollapsiblePanel.java @@ -1,3 +1,24 @@ +/* + + DIY Layout Creator (DIYLC). + Copyright (c) 2009-2018 held jointly by the individual authors. + + This file is part of DIYLC. + + DIYLC is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + DIYLC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DIYLC. If not, see . + +*/ package org.diylc.swing.gui; import java.awt.BorderLayout; @@ -23,18 +44,22 @@ public class CollapsiblePanel extends JPanel { private static final long serialVersionUID = 1L; - private static int thickness = 4; + private static int BORDER_THICKNESS = 4; private MatteBorderEx border; private Color defaultColor = Color.lightGray; private Color highlightColor = Color.decode("#66CCFF"); + /** + * + * @param position designates the direction in which the panel should collapse + */ public CollapsiblePanel(int position) { - border = new MatteBorderEx(position == SwingConstants.BOTTOM ? thickness : 0, - position == SwingConstants.RIGHT ? thickness : 0, - position == SwingConstants.TOP ? thickness : 0, - position == SwingConstants.LEFT ? thickness : 0, defaultColor); + border = new MatteBorderEx(position == SwingConstants.BOTTOM ? BORDER_THICKNESS : 0, + position == SwingConstants.RIGHT ? BORDER_THICKNESS : 0, + position == SwingConstants.TOP ? BORDER_THICKNESS : 0, + position == SwingConstants.LEFT ? BORDER_THICKNESS : 0, defaultColor); setToolTipText("Click to collapse"); setBorder(border); BorderLayout borderLayout = new BorderLayout();