View Javadoc

1   package com.explosion.expf.menusandtools.menu.segmented;
2   
3   /*
4    * =============================================================================
5    * 
6    * Copyright 2004 Stephen Cowx
7    * 
8    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
9    * use this file except in compliance with the License. You may obtain a copy of
10   * the License at
11   * 
12   * http://www.apache.org/licenses/LICENSE-2.0
13   * 
14   * Unless required by applicable law or agreed to in writing, software
15   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17   * License for the specific language governing permissions and limitations under
18   * the License.
19   * 
20   * =============================================================================
21   */
22  
23  import java.awt.Component;
24  
25  import com.explosion.expf.menusandtools.menu.InvalidOrUnknownSegmentException;
26  
27  /***
28   * Title: Description:
29   * 
30   * @author Stephen Cowx
31   */
32  
33  public class ExpMenuSegment
34  {
35  
36      public static final int ALWAYS_FIRST_SEGMENT = 0;
37      public static final int ALWAYS_LAST_SEGMENT = 1;
38      public static final int ANY_POSITION = 2;
39  
40      private ExpSegmentedMenu menu;
41      
42      public ExpMenuSegment(ExpSegmentedMenu menu)
43      {
44         this.menu = menu;
45      }
46      
47      /***
48       * You can use this method or the ExpSegmentedMenu.addElementToSegment method.  the effect should be the same
49       * @param element
50       * @throws InvalidOrUnknownSegmentException
51       */
52      public void addElement(Component element) throws InvalidOrUnknownSegmentException
53      {
54          menu.addElementToSegment(this, element);
55      }
56      
57  }