root/as3/PSDParser/src/com/voidelement/images/psd/resources/Slice.as

リビジョン 97, 4.2 kB (コミッタ: munegon, コミット時期: 5 年 前)

--

Line 
1 /**
2  * com.voidelement.images.psd.PSDParser  Class for ActionScript 3.0
3  * 
4  * @author       Copyright (c) 2007 munegon
5  * @version      0.2
6  * 
7  * @link         http://www.voidelement.com/
8  * @link         http://void.heteml.jp/blog/
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  * 
14  * http://www.apache.org/licenses/LICENSE-2.0
15  * 
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
19  * either express or implied. See the License for the specific language
20  * governing permissions and limitations under the License.
21  */
22
23
24 package com.voidelement.images.psd.resources {
25         import com.voidelement.images.psd.PSDParser;
26         import com.voidelement.images.psd.core.SliceRect;
27         import com.voidelement.images.psd.core.VString;
28        
29         import flash.utils.ByteArray;
30        
31         public class Slice {
32                 private var _id:uint;
33                 public function get id():uint { return _id; }
34                
35                 private var _groupID:uint;
36                 public function get groupID():uint { return _groupID; }
37                
38                 private var _origin:uint;
39                 public function get origin():uint { return _origin; }
40                
41                 private var _name:VString;
42                 public function get name():VString { return _name; }
43                
44                 private var _type:uint;
45                 public function get type():uint { return _type; }
46                
47                 private var _rect:SliceRect;
48                 public function get rect():SliceRect { return _rect; }
49                
50                 private var _url:VString;
51                 public function get url():VString { return _url; }
52                
53                 private var _target:VString;
54                 public function get target():VString { return _target; }
55                
56                 private var _message:VString;
57                 public function get message():VString { return _message; }
58                
59                 private var _allTag:VString;
60                 public function get allTag():VString { return _allTag; }
61                
62                 private var _cellIsHtml:Boolean;
63                 public function get cellIsHtml():Boolean { return _cellIsHtml; }
64                
65                 private var _cellText:VString;
66                 public function get cellText():VString { return _cellText; }
67                
68                 private var _hAlign:uint;
69                 public function get hAlign():uint { return _hAlign; }
70                
71                 private var _vAlign:uint;
72                 public function get vAlign():uint { return _vAlign; }
73                
74                 private var _aColor:uint;
75                 public function get aColor():uint { return _aColor; }
76                
77                 private var _rColor:uint;
78                 public function get rColor():uint { return _rColor; }
79                
80                 private var _gColor:uint;
81                 public function get gColor():uint { return _gColor; }
82                
83                 private var _bColor:uint;
84                 public function get bColor():uint { return _bColor; }
85                
86                
87                 public function Slice( stream:ByteArray ) {
88                         _id = stream.readUnsignedInt();
89                         _groupID = stream.readUnsignedInt();
90                         _origin = stream.readUnsignedInt();
91                         _name = new VString( stream );
92                         _type = stream.readUnsignedInt();
93                         _rect = new SliceRect( stream );
94                         _url = new VString( stream );
95                         _target = new VString( stream );
96                         _message = new VString( stream );
97                         _allTag = new VString( stream );
98                        
99                         _cellIsHtml = stream.readBoolean();
100                         _cellText = new VString( stream );
101                        
102                         _hAlign = stream.readUnsignedInt();
103                         _vAlign = stream.readUnsignedInt();
104                        
105                         _aColor = stream.readUnsignedByte();
106                         _rColor = stream.readUnsignedByte();
107                         _gColor = stream.readUnsignedByte();
108                         _bColor = stream.readUnsignedByte();
109                        
110                        
111                         PSDParser.log("    id: " + id );
112                         PSDParser.log("    groupID: " + groupID );
113                         PSDParser.log("    origin: " + origin );
114                         PSDParser.log("    name: " + name );
115                         PSDParser.log("    type: " + type );
116                         PSDParser.log("    rect: " + rect );
117                         PSDParser.log("    url: " + url );
118                         PSDParser.log("    target: " + target );
119                         PSDParser.log("    message: " + message );
120                         PSDParser.log("    allTag: " + allTag );
121                        
122                         PSDParser.log("    cellIsHtml: " + cellIsHtml );
123                         PSDParser.log("    cellText: " + cellText );
124                        
125                         PSDParser.log("    hAlign: " + hAlign );
126                         PSDParser.log("    vAlign: " + vAlign );
127                        
128                         PSDParser.log("    aColor: " + aColor );
129                         PSDParser.log("    rColor: " + rColor );
130                         PSDParser.log("    gColor: " + gColor );
131                         PSDParser.log("    bColor: " + bColor );
132                 }
133         }
134 }
Note: リポジトリブラウザについてのヘルプは TracBrowser を参照してください。