Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /* ====================================================================
     Licensed to the Apache Software Foundation (ASF) under one or more
     contributor license agreements.  See the NOTICE file distributed with
     this work for additional information regarding copyright ownership.
     The ASF licenses this file to You under the Apache License, Version 2.0
     (the "License"); you may not use this file except in compliance with
     the License.  You may obtain a copy of the License at
  
         http://www.apache.org/licenses/LICENSE-2.0
 
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
 ==================================================================== */
 
 package org.apache.poi.hslf.model;
 
 
 import java.awt.*;

Represents a cell in a ppt table

Author(s):
Yegor Kozlov
 
 public final class TableCell extends TextBox {
     protected static final int DEFAULT_WIDTH = 100;
     protected static final int DEFAULT_HEIGHT = 40;
 
     private Line borderLeft;
     private Line borderRight;
     private Line borderTop;
     private Line borderBottom;

    
Create a TableCell object and initialize it from the supplied Record container.

Parameters:
escherRecord EscherSpContainer container which holds information about this shape
parent the parent of the shape
 
    protected TableCell(EscherContainerRecord escherRecordShape parent){
         super(escherRecordparent);
     }

    
Create a new TableCell. This constructor is used when a new shape is created.

Parameters:
parent the parent of this Shape. For example, if this text box is a cell in a table then the parent is Table.
 
     public TableCell(Shape parent){
         super(parent);
 
         setShapeType(.);
         //_txtrun.setRunType(TextHeaderAtom.HALF_BODY_TYPE);
         //_txtrun.getRichTextRuns()[0].setFlag(false, 0, false);
     }
 
     protected EscherContainerRecord createSpContainer(boolean isChild){
          = super.createSpContainer(isChild);
         setEscherProperty(opt., 0);
         setEscherProperty(opt., 0x150001);
 
         return ;
     }
 
     protected void anchorBorder(int typeLine line){
         Rectangle cellAnchor = getAnchor();
         Rectangle lineAnchor = new Rectangle();
         switch(type){
             case .:
                 lineAnchor.x = cellAnchor.x;
                 lineAnchor.y = cellAnchor.y;
                 lineAnchor.width = cellAnchor.width;
                 lineAnchor.height = 0;
                 break;
             case .:
                 lineAnchor.x = cellAnchor.x + cellAnchor.width;
                 lineAnchor.y = cellAnchor.y;
                 lineAnchor.width = 0;
                 lineAnchor.height = cellAnchor.height;
                 break;
             case .:
                 lineAnchor.x = cellAnchor.x;
                 lineAnchor.y = cellAnchor.y + cellAnchor.height;
                 lineAnchor.width = cellAnchor.width;
                 lineAnchor.height = 0;
                 break;
             case .:
                 lineAnchor.x = cellAnchor.x;
                 lineAnchor.y = cellAnchor.y;
                 lineAnchor.width = 0;
                lineAnchor.height = cellAnchor.height;
                break;
            default:
                throw new IllegalArgumentException("Unknown border type: " + type);
        }
        line.setAnchor(lineAnchor);
    }
    public Line getBorderLeft() {
        return ;
    }
    public void setBorderLeft(Line line) {
        if(line != nullanchorBorder(.line);
        this. = line;
    }
    public Line getBorderRight() {
        return ;
    }
    public void setBorderRight(Line line) {
        if(line != nullanchorBorder(.line);
        this. = line;
    }
    public Line getBorderTop() {
        return ;
    }
    public void setBorderTop(Line line) {
        if(line != nullanchorBorder(.line);
        this. = line;
    }
    public Line getBorderBottom() {
        return ;
    }
    public void setBorderBottom(Line line) {
        if(line != nullanchorBorder(.line);
        this. = line;
    }
    public void setAnchor(Rectangle anchor){
        super.setAnchor(anchor);
        if( != nullanchorBorder(.);
        if( != nullanchorBorder(.);
        if( != nullanchorBorder(.);
        if( != nullanchorBorder(.);
    }
New to GrepCode? Check out our FAQ X