Changeset 1707

Show
Ignore:
Timestamp:
01/07/12 17:40:13 (4 months ago)
Author:
icare4
Message:

Ticket 199 resolution

Location:
trunk/src/org/rapla
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/org/rapla/RaplaResources.xml

    r1695 r1707  
    566566        <text lang="pl">Drukuj</text> 
    567567    </entry> 
     568    <entry key="printdocument"> 
     569        <text lang="en">Print</text> 
     570        <text lang="de">Drucke</text> 
     571        <text lang="fr">Imprimer</text> 
     572        <text lang="es">Imprimir</text> 
     573        <text lang="cs">Tisknout</text> 
     574        <text lang="nl">Afdrukken</text> 
     575        <text lang="pl">Drukuj</text> 
     576    </entry> 
    568577    <entry key="print_to_file"> 
    569578        <text lang="en">Print to File</text> 
     
    20842093        <text lang="nl">Geregistreerd  door</text> 
    20852094        <text lang="pl">Rezerwacja przez</text> 
     2095    </entry> 
     2096    <entry key="on"> 
     2097        <text lang="en">on</text> 
     2098        <text lang="de">am</text> 
     2099        <text lang="fr">à la</text> 
     2100        <text lang="es">en el</text> 
     2101        <text lang="cs">na</text> 
     2102        <text lang="nl">aan de</text> 
     2103        <text lang="pl">na</text> 
    20862104    </entry> 
    20872105    <entry key="resource.owner"> 
  • trunk/src/org/rapla/components/calendarview/swing/AbstractSwingCalendar.java

    r1567 r1707  
    7272    /** Calendar used by the put block method */ 
    7373    protected Calendar blockCalendar; 
     74    /** Differing slot size for resource column */ 
     75    private int resourceSlotSize; 
    7476 
    7577    AbstractSwingCalendar(boolean showScrollPane) { 
     
    8688            scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); 
    8789            scrollPane.setViewportView(jCenter); 
    88            
    89              
    90  
    9190            scrollPane.setColumnHeaderView(jTitlePanel); 
    9291            scrollPane.getVerticalScrollBar().setUnitIncrement(10); 
     
    360359    abstract Date createDate( DaySlot slot, int row, boolean startOfRow); 
    361360 
     361        public int getResourceSlotSize() { 
     362                return resourceSlotSize; 
     363        } 
     364 
     365        public void setResourceSlotSize(int resourceSlotSize) { 
     366                this.resourceSlotSize = resourceSlotSize; 
     367        } 
     368 
    362369 
    363370} 
  • trunk/src/org/rapla/components/calendarview/swing/SwingCompactWeekView.java

    r1499 r1707  
    142142 
    143143        if ( slotNames.length > 0) { 
    144                 tableLayout.insertColumn(0, slotSize); 
     144                tableLayout.insertColumn(0, getResourceSlotSize()); 
    145145                jHeader.add( createSlotHeader( null ), "0,0,l,t" ); 
    146146        } else { 
     
    151151        for (int column=0;column<COLUMNS;column++) { 
    152152            if ( !isExcluded(column) ) { 
    153                 tableLayout.insertColumn(column + 1, slotSize ); 
     153                int width = getSlotSize();                               
     154                tableLayout.insertColumn(column + 1, width ); 
    154155                jHeader.add( createSlotHeader( calendar.getTime() ) ); 
    155156            } else { 
     
    187188        if ( slot < slotNames.length ) { 
    188189            label.setText( slotNames[ slot ] ); 
     190            label.setToolTipText(slotNames[ slot] ); 
    189191        } 
    190192        return label; 
     
    202204            jLabel.setBorder(isEditable() ? SLOTHEADER_BORDER : null); 
    203205        } 
    204         Dimension dim = new Dimension(this.slotSize,20); 
     206        int width = -1; 
     207        if( date == null ) 
     208        { 
     209            jLabel.setBorder(SLOTHEADER_BORDER); 
     210                width = getResourceSlotSize(); 
     211        } 
     212        else 
     213        { 
     214                width = getSlotSize(); 
     215        } 
     216        Dimension dim = new Dimension(width,20); 
    205217        jLabel.setPreferredSize( dim); 
    206218        jLabel.setMinimumSize( dim ); 
     
    210222 
    211223    private SmallDaySlot createField(List blocks, int column)  { 
    212         SmallDaySlot c= new SmallDaySlot("",slotSize, Color.BLACK); 
     224        int width = getSlotSize();                       
     225        SmallDaySlot c= new SmallDaySlot("", width, Color.BLACK); 
    213226        c.setEditable(isEditable()); 
    214227        c.setDraggingHandler(draggingHandler); 
  • trunk/src/org/rapla/gui/internal/view/ClassificationInfoUI.java

    r1685 r1707  
    2020 
    2121import org.rapla.entities.Timestamp; 
     22import org.rapla.entities.domain.Reservation; 
    2223import org.rapla.entities.dynamictype.AttributeAnnotations; 
    2324import org.rapla.entities.dynamictype.Attribute; 
    2425import org.rapla.entities.dynamictype.Classifiable; 
    2526import org.rapla.entities.dynamictype.Classification; 
     27import org.rapla.entities.storage.RefEntity; 
     28import org.rapla.entities.storage.internal.SimpleIdentifier; 
    2629import org.rapla.framework.RaplaContext; 
    2730import org.rapla.framework.RaplaException; 
     
    3740        Locale locale = getRaplaLocale().getLocale(); 
    3841        encode( classification.getType().getName(locale), buf ); 
     42        if ( classifiable instanceof RefEntity ) 
     43        {                
     44                int id = ((SimpleIdentifier)((RefEntity) classifiable).getId()).getKey(); 
     45                buf.append(" ("); 
     46                buf.append(Integer.valueOf(id)); 
     47                buf.append(")"); 
     48        } 
    3949        buf.append( "</strong>"); 
    4050    } 
     
    100110        if ( lastChangeTime != null) 
    101111        { 
    102             buf.append("<div style=\"font-size:7px;margin-bottom:4px;\">"); 
     112            buf.append("<div style=\"font-size:8px;margin-bottom:4px;\">"); 
    103113            if ( createTime != null) 
    104114            { 
  • trunk/src/org/rapla/gui/internal/view/ReservationInfoUI.java

    r1685 r1707  
    8989        final Locale locale = getLocale(); 
    9090        final String ownerName = owner.getName(locale); 
    91         String ownerText = encode(ownerName); 
    92         if (controller != null) 
    93             ownerText = controller.createLink(owner,ownerName); 
    94          
    95         att.add( new Row(getString("reservation.owner"), ownerText)); 
     91        StringBuilder ownerText = new StringBuilder(); 
     92        if (controller == null) 
     93        { 
     94                ownerText.append( encode(ownerName) ); 
     95        } 
     96        else 
     97        { 
     98            ownerText.append( controller.createLink(owner,ownerName) ); 
     99        } 
     100        ownerText.append( " "); 
     101        ownerText.append( getI18n().getString("on") ); 
     102        ownerText.append( " "); 
     103        ownerText.append( getRaplaLocale().formatDate(reservation.getCreateTime()) );         
     104        att.add( new Row(getString("reservation.owner"), ownerText.toString() )); 
    96105        User lastChangeBy = reservation.getLastChangedBy(); 
    97106        if ( lastChangeBy != null && (owner == null ||! lastChangeBy.equals(owner))) { 
  • trunk/src/org/rapla/plugin/compactweekview/SwingCompactWeekCalendar.java

    r1319 r1707  
    3636import org.rapla.components.calendarview.swing.ViewListener; 
    3737import org.rapla.components.util.DateTools; 
     38import org.rapla.components.xmlbundle.I18nBundle; 
    3839import org.rapla.entities.NamedComparator; 
    3940import org.rapla.entities.domain.Allocatable; 
     
    5253public class SwingCompactWeekCalendar extends AbstractRaplaSwingCalendar 
    5354{ 
     55        /** 
     56         * Default slot size for each column of calendar view 
     57         * TODO: Make configurable 
     58         */ 
     59        private static final int DEFAULTSLOTSIZE = 120; 
     60        /** 
     61         * Default slot size for resource column preceding day columns 
     62         */ 
     63        private static final int DEFAULTRESOURCESLOTSIZE = 70; 
     64         
    5465    public SwingCompactWeekCalendar(RaplaContext sm,CalendarModel settings, boolean editable) throws RaplaException { 
    5566        super( sm, settings, editable); 
     
    7586                        component.setToolTipText(toolTip); 
    7687                    } 
     88                } 
     89                else 
     90                {                        
     91                        String text = getI18n().getString("resources"); 
     92                        component.setText(text); 
     93                        component.setOpaque(true);                     
     94                    component.setToolTipText(text); 
    7795                } 
    7896                return component; 
     
    159177        if ( !view.isEditable() ) { 
    160178            view.setSlotSize( model.getSize()); 
     179            view.setResourceSlotSize(model.getSize()); 
    161180        } else { 
    162             view.setSlotSize( 150 ); 
    163         } 
     181            view.setSlotSize( DEFAULTSLOTSIZE ); 
     182            view.setResourceSlotSize(DEFAULTRESOURCESLOTSIZE); 
     183        }         
    164184    } 
    165185