当前位置: 首页>>代码示例>>Python>>正文


Python Hyperlink.setPixelSize方法代码示例

本文整理汇总了Python中pyjamas.ui.Hyperlink.Hyperlink.setPixelSize方法的典型用法代码示例。如果您正苦于以下问题:Python Hyperlink.setPixelSize方法的具体用法?Python Hyperlink.setPixelSize怎么用?Python Hyperlink.setPixelSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyjamas.ui.Hyperlink.Hyperlink的用法示例。


在下文中一共展示了Hyperlink.setPixelSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from pyjamas.ui.Hyperlink import Hyperlink [as 别名]
# 或者: from pyjamas.ui.Hyperlink.Hyperlink import setPixelSize [as 别名]
    def __init__(self):
        GChart.__init__(self)

        self.SELECTION_CURVE = 0 # curve index of selection cursor
        self.p1 = Point(); # first corner (@mousedown) of selection rect
        self.p2 = Point(); # second corner (@mouseup) of selection rect
        self.selecting = False
        self.moving = False
        self.ctrlPressed = False; # as evaluated at mouse down
        self.altPressed = False
        # (# zoom ins) - (# zoom outs) since selection rect created
        # lets us know when to restore initial plot area limits/cursor
        self.zoomIndex = 0
        self.zoomController = ZoomController(self)
        # min plot area fraction zoom selection cursor must capture
        
        self.initialPlotRegion = Region()
        self.initialSelectionRegion = Region()
    
        self.setChartTitle(
        "Drag to pan; Press Ctrl while drag-selecting a rectangle to zoom")
        self.setChartSize(500, 150)
        a = Hyperlink("huh?")
        a.setPixelSize(10, 500)
        self.getYAxis().setAxisLabel(a)
        # another option is to use clipToDecoratedChart(True) instead.
        self.setClipToPlotArea(True)
        self.addCurve()
        for i in range(N_POINTS):
            self.getCurve().addPoint(i, math.sin((2* math.pi * i)/N_POINTS)*
                        math.sin(10*(2* math.pi * i)/N_POINTS))
        
        self.getCurve().getSymbol().setSymbolType(SymbolType.LINE)
        
        # will use this curve to create the selection cursor
        self.addCurve()
        self.getCurve().addPoint(-Double.MAX_VALUE, -Double.MAX_VALUE)
        self.getCurve().setVisible(False)
        # preferentially selects cursor over ordinary curves:
        self.getCurve().getSymbol().setDistanceMetric(0,0)
        self.getCurve().getSymbol().setHoverWidget(self.zoomController)
        self.getCurve().getSymbol().setHoverLocation( AnnotationLocation.CENTER)
        # hides hover-buttons when mouse is outside zoom-cursor
        self.getCurve().getSymbol().setBrushSize(0, 0)
        self.SELECTION_CURVE = self.getNCurves()-1
        # give them some x-panning space
        self.getXAxis().setAxisMin(0.25*N_POINTS)
        self.getXAxis().setAxisMax(0.75*N_POINTS)
        
        self.getYAxis().setTickLabelThickness(50)
        self.getYAxis().setAxisMin(-0.5)
        self.getYAxis().setAxisMax(0.5)
        
        """
        self.addClickListener(self)
        """
        self.addMouseListener(self)
开发者ID:FreakTheMighty,项目名称:pyjamas,代码行数:59,代码来源:GChartExample24.py


注:本文中的pyjamas.ui.Hyperlink.Hyperlink.setPixelSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。