Class SimpleAnchor

java.lang.Object
org.miaixz.bus.office.excel.SimpleAnchor
All Implemented Interfaces:
org.apache.poi.ss.usermodel.ClientAnchor

public class SimpleAnchor extends Object implements org.apache.poi.ss.usermodel.ClientAnchor
简单的ClientAnchor实现,此对象表示一个图形或绘图在Excel中的位置和大小,参数表示:
  • dx1和dy1表示在左上角单元格中的偏移量,col1和row1表示左上角单元格
  • dx2和dy2表示在右下角单元格中的偏移量,col2和row2表示右下角单元格
图示见:https://www.cnblogs.com/sunyl/p/7527703.html
Since:
Java 17+
Author:
Kimi Liu
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.apache.poi.ss.usermodel.ClientAnchor

    org.apache.poi.ss.usermodel.ClientAnchor.AnchorType
  • Constructor Summary

    Constructors
    Constructor
    Description
    SimpleAnchor(int col1, int row1, int col2, int row2)
    构造 通过定义左上角和右下角的单元格,创建一个ClientAnchor对象 默认偏移为0,默认type为: ClientAnchor.AnchorType.MOVE_AND_RESIZE.
    SimpleAnchor(int dx1, int dy1, int dx2, int dy2, int col1, int row1, int col2, int row2)
    构造 通过定义左上角和右下角的单元格,以及单元格中的偏移量,创建一个ClientAnchor对象 默认type为: ClientAnchor.AnchorType.MOVE_AND_RESIZE.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.poi.ss.usermodel.ClientAnchor
    copyTo(org.apache.poi.ss.usermodel.ClientAnchor clientAnchor)
    将当前对象中的值复制到目标对象中
    org.apache.poi.ss.usermodel.ClientAnchor.AnchorType
     
    short
     
    short
     
    int
     
    int
     
    int
     
    int
     
    int
     
    int
     
    void
    setAnchorType(org.apache.poi.ss.usermodel.ClientAnchor.AnchorType anchorType)
     
    void
    setCol1(int col1)
     
    void
    setCol2(int col2)
     
    void
    setDx1(int dx1)
     
    void
    setDx2(int dx2)
     
    void
    setDy1(int dy1)
     
    void
    setDy2(int dy2)
     
    void
    setRow1(int row1)
     
    void
    setRow2(int row2)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SimpleAnchor

      public SimpleAnchor(int col1, int row1, int col2, int row2)
      构造 通过定义左上角和右下角的单元格,创建一个ClientAnchor对象 默认偏移为0,默认type为: ClientAnchor.AnchorType.MOVE_AND_RESIZE.
      Parameters:
      col1 - 指定起始的列,下标从0开始
      row1 - 指定起始的行,下标从0开始
      col2 - 指定结束的列,下标从0开始
      row2 - 指定结束的行,下标从0开始
    • SimpleAnchor

      public SimpleAnchor(int dx1, int dy1, int dx2, int dy2, int col1, int row1, int col2, int row2)
      构造 通过定义左上角和右下角的单元格,以及单元格中的偏移量,创建一个ClientAnchor对象 默认type为: ClientAnchor.AnchorType.MOVE_AND_RESIZE.
      Parameters:
      dx1 - 起始单元格中的x偏移像素
      dy1 - 起始单元格中的y偏移像素
      dx2 - 结束单元格中的x偏移像素
      dy2 - 结束单元格中的y偏移像素
      col1 - 指定起始的列,下标从0开始
      row1 - 指定起始的行,下标从0开始
      col2 - 指定结束的列,下标从0开始
      row2 - 指定结束的行,下标从0开始
  • Method Details

    • getDx1

      public int getDx1()
      Specified by:
      getDx1 in interface org.apache.poi.ss.usermodel.ClientAnchor
    • setDx1

      public void setDx1(int dx1)
      Specified by:
      setDx1 in interface org.apache.poi.ss.usermodel.ClientAnchor
    • getDy1

      public int getDy1()
      Specified by:
      getDy1 in interface org.apache.poi.ss.usermodel.ClientAnchor
    • setDy1

      public void setDy1(int dy1)
      Specified by:
      setDy1 in interface org.apache.poi.ss.usermodel.ClientAnchor
    • getDx2

      public int getDx2()
      Specified by:
      getDx2 in interface org.apache.poi.ss.usermodel.ClientAnchor
    • setDx2

      public void setDx2(int dx2)
      Specified by:
      setDx2 in interface org.apache.poi.ss.usermodel.ClientAnchor
    • getDy2

      public int getDy2()
      Specified by:
      getDy2 in interface org.apache.poi.ss.usermodel.ClientAnchor
    • setDy2

      public void setDy2(int dy2)
      Specified by:
      setDy2 in interface org.apache.poi.ss.usermodel.ClientAnchor
    • getCol1

      public short getCol1()
      Specified by:
      getCol1 in interface org.apache.poi.ss.usermodel.ClientAnchor
    • setCol1

      public void setCol1(int col1)
      Specified by:
      setCol1 in interface org.apache.poi.ss.usermodel.ClientAnchor
    • getRow1

      public int getRow1()
      Specified by:
      getRow1 in interface org.apache.poi.ss.usermodel.ClientAnchor
    • setRow1

      public void setRow1(int row1)
      Specified by:
      setRow1 in interface org.apache.poi.ss.usermodel.ClientAnchor
    • getCol2

      public short getCol2()
      Specified by:
      getCol2 in interface org.apache.poi.ss.usermodel.ClientAnchor
    • setCol2

      public void setCol2(int col2)
      Specified by:
      setCol2 in interface org.apache.poi.ss.usermodel.ClientAnchor
    • getRow2

      public int getRow2()
      Specified by:
      getRow2 in interface org.apache.poi.ss.usermodel.ClientAnchor
    • setRow2

      public void setRow2(int row2)
      Specified by:
      setRow2 in interface org.apache.poi.ss.usermodel.ClientAnchor
    • getAnchorType

      public org.apache.poi.ss.usermodel.ClientAnchor.AnchorType getAnchorType()
      Specified by:
      getAnchorType in interface org.apache.poi.ss.usermodel.ClientAnchor
    • setAnchorType

      public void setAnchorType(org.apache.poi.ss.usermodel.ClientAnchor.AnchorType anchorType)
      Specified by:
      setAnchorType in interface org.apache.poi.ss.usermodel.ClientAnchor
    • copyTo

      public org.apache.poi.ss.usermodel.ClientAnchor copyTo(org.apache.poi.ss.usermodel.ClientAnchor clientAnchor)
      将当前对象中的值复制到目标对象中
      Parameters:
      clientAnchor - ClientAnchor
      Returns:
      目标对象